1

I'm confusion in the latest Ubuntu 17.04 Gnome, I even cannot find the file /etc/rc.d/rc.local. If the system has it, I can add my command in it. Then the command will run once the system start. But since this file is non-exist,how should I implement it?

1

To run an application when the system start, put your .desktop file in /etc/xdg/autostart

/etc/xdg/autostart/programtostart.desktop

xdg-autostart manual

| improve this answer | |
  • 1
    or if not found you can set it for the user at `/home/username/.config/autostart/programtostart.desktop .. but im on 16.04 so maybe its different in 17.04 – John Orion Dec 9 '17 at 19:44
  • 1
    I can also do it in the GUI under Start-Settings-Session and Startup in the Application Autostart tab – John Orion Dec 9 '17 at 19:47
1

You can use the crontab for this if it should be simply done at reboot, you can do it in your own crontab or in other users crontab, depending on which you need to use sudo respectively:

sudo crontab -e -u <username>

If you are editing your own crontab you can omit sudo and the -u <username>. Simply adding a line like this suffices:

@reboot    /full/path/to/script

Hope it helps, for further reading see the manpage for the crontab command .

| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.