Thursday, February 9, 2017

What is the correct way to run a command after boot on ubuntu 18.04?

I need to run a simple batch of commands after the computer boots, something like


sudo thing
sudo thing1 -p

But for the life of me I can't figure out how.
I googled and googled and I kept finding the same thing: Place the commands into a /etc/rc.local or /etc/init.d/rc.local file. The problem is that none of those files exist on my system!
Furthermore, I have read that /etc/rc.local is deprecated anyway, so what the correct and simple way to do this?


I would like to know how to these two things:



  • run a command after the computer boots

  • run a command after specified user logs in, and run it as the given user


    (And make all that happen solely by editing stuff in the terminal, no GUI tools)



Thank you.

No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...