User forums > Help

Run command after build

(1/1)

antotan:
Hello. I need to run "apache2ctl restart" after every project build.
How can I do this?

Jenna:

--- Quote from: antotan on February 26, 2010, 11:49:47 am ---Hello. I need to run "apache2ctl restart" after every project build.
How can I do this?

--- End quote ---
Use the postbuild steps in the projects build options.

antotan:
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?

rcoll:
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

Jenna:

--- Quote from: rcoll 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


--- End quote ---
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>"

Navigation

[0] Message Index

Go to full version