M BUZZ CRAZE NEWS
// general

Start command as superuser at login (SOLVED)

By Emma Johnson

How can I start a command as superuser at startup on Xubuntu? Normally I enter any command in the option 'Session and Startup -> Application Autostart', but I don't know how to do it as superuser since if I enter the command preceded by sudo or pkexec nothing happens (I also don't want to be asked for the password at startup, since I have already logged in).

5

1 Answer

I've finally fixed it by adding the hdparm command in sudoers. For this I have run sudo visudo and added the following line (important that it be added to the end of the file for the rule to apply): MY_USER ALL=(root) NOPASSWD: /sbin/hdparm, replacing "MY_USER" by my user.

Once this is done we can add the command in the "Start Applications" menu. The command must also have "sudo" in front.

In this thread there is a very similar case: [Run script as root immediately after login to gui

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy