Home > manjaro > [manjaro] run a command at startup as root

[manjaro] run a command at startup as root

Manjaro (and Arch) uses systemd as a system and service manager, which differs from Ubuntu’s upstart. Under Ubuntu it is enough to edit /etc/rc.local and those commands are executed upon boot. How to mimic this functionality with systemd?

I found a nice solution in this thread, posted by patroclo7. Here I just copy his solution.

Create the file /etc/rc.d/rc.local and make it executable (chmod u+x). In this file add the command(s) you want to execute at startup.

Then, create a service file for rc.local in /etc/systemd/system/rc-local.service with this content:

Description=/etc/rc.local compatibility



Finally, enable it:

systemctl enable rc-local

Now if you reboot, the commands in rc.local will be executed with root privileges.


Categories: manjaro Tags: , ,
  1. msx
    August 14, 2015 at 09:15

    This a very ugly hack from I myself are culprit too :P
    Every application we want to launch at start up should have its own service unit and for those cases when we need to interface with /sys, create files, etc., we should *really* use /etc/tmpfiles.d

  2. msx
    August 14, 2015 at 09:17

    “This is a very ugly hack which I myself am a culprit too”
    Fuck, I suck sometimes, specially when I’m half-asleep.

  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: