Unsolved Custom command during stop - Qt Creator
-
Hello,
When I run the application from Qt creator, since I have rightly mentioned the path for the executable, application runs successfully.
Few questions -
- My application needs sudo permission to build. I don't know where to mention "sudo".
- My application needs sudo permission to run. Not sure on how to specify.
For these two, I have a way to overcome - Start the Qt Creator with "sudo" permission. Any other smart ways?
- This is tricky. When I stop the application from Qt creator. I am sure that it would send "kill" signal and kill the application. Whereas, In my case, I need to pass some flags as well during the kill command being executed.
How to achieve this?
Thanks,
Kumara -
i am by far not a linux guru, but wouldn't it help to start QtCreator already with "sudo"?
-
Hi,
When I start the Qt Creator with sudo, yes it helps me in building and running the application.
In case of stop or kill, I need to pass some arguments to the kill command. How to do that?
-
@kumararajas Why do you need sudo to build your application?
What parameters do you want to pass to your application if you stop it? -
@jsulm
Why do you need sudo to build your application?My application uses system resources such as message queues, which needs sudo permission for my application to access them.
What parameters do you want to pass to your application if you stop it?
My application creates many child processes. When I want to kill my application, I need to shutdown the child process safely. So I need to pass -15 for the kill command.
Example, sudo pkill -15 "MyApp", this will help the child process the shutdown cleanly and release all the resources.
-
@kumararajas
"My application uses system resources such as message queues, which needs sudo permission for my application to access them." - that's on runtime. Why do you need sudo to BUILD your app?You can use a signal handler in your app, see "man sigaction" (not Qt related).