Author Topic: Run command after build  (Read 3972 times)

Offline antotan

  • Single posting newcomer
  • *
  • Posts: 2
Run command after build
« on: February 26, 2010, 11:49:47 am »
Hello. I need to run "apache2ctl restart" after every project build.
How can I do this?

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Run command after build
« Reply #1 on: February 26, 2010, 11:57:48 am »
Hello. I need to run "apache2ctl restart" after every project build.
How can I do this?
Use the postbuild steps in the projects build options.

Offline antotan

  • Single posting newcomer
  • *
  • Posts: 2
Re: Run command after build
« Reply #2 on: February 26, 2010, 12:19:21 pm »
thank you. I'v put in post build steps "sudo apache2ctl restart" but, obviusly, c::b told me that there's no tty and no askpass specified.
How can I allow execution of apache2ctl from my user, without do sudo? Or, how can I prompt a password within c::b?

Offline rcoll

  • Almost regular
  • **
  • Posts: 150
Re: Run command after build
« Reply #3 on: February 26, 2010, 12:25:31 pm »
Write a script or batch file that will do exactly what you want it to do, then run that script or batch file from the post-build steps.

Ringo

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Run command after build
« Reply #4 on: February 26, 2010, 12:32:33 pm »
Write a script or batch file that will do exactly what you want it to do, then run that script or batch file from the post-build steps.

Ringo

The script still needs root-access.

But the script can be run thro a graphical front-end to su.

I use "su-to-root" from the "menu"-package, but "gksu" or "kdesudo" should also work.

In my case: "su-to-root -X -c </path/to/script>"