Answer the question
In order to leave comments, you need to log in
Running "sudo x" in ubuntu autostart
Probably a stupid question, but still. How can I correctly implement the launch of a similar command: "sudo vh_runhub" in autorun on ubuntu?
It would be possible to create a file /etc/init.d/verlihub and write "sudo vh_runhub" in it,
then do
chmod +x /etc/init.d/verlihub
rc-update add verlihub default
But this does not seem to be a working way ...
Answer the question
In order to leave comments, you need to log in
If vh_runhub needs to be run as root, then in this case sudo should be omitted altogether. Commands in init.d are executed as root.
No sudo. Or a human service script or /etc/rc.local.
If it can’t be launched from the root, but it starts from the user, then it lacks either some settings (suddenly it stores them somewhere in ~, I don’t know, I didn’t use them), or some environment variables.
Depending on what version of Ubuntu. Since 11.10, the autorun logic has been changed, and if before the actions you listed were enough to add to autorun, now it is not enough.
And, as already said, in /etc/init.d/ you only need sudo if you want to run the command on behalf of another user (not root), for example,
sudo su vasyapupkin -c "/usr/bin/SUPERFILE"
PS Maybe, of course, you didn’t add it, but it’s
sudo vh_runhub
not enough, you need add
#!/bin/sh
append script launch to /etc/rc.local
or crontab with option to start at startup
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question