How to re-enable rc.local in systemd

    First,systemd sucks. There is no two ways about this. It violates the first rule of computer science:


    Keep
    It
    Simple
    Stupid

    ...(and just about any other rule of computer science you can apply to it).

    Second, create or modify the /etc/rc.local to do what you want it to do. Make sure that it ends with an "exit 0" at the end. Make sure it's executable.

    chmod +x /etc/rc.local

     

    Hint: You can call other scripts from within /etc/rc.local.

     

     Third, create the unit file:

    echo '[Unit]
    Description=Start local scripts (i.e. /etc/rc.local)
    ConditionPathExists=/etc/rc.local
     
    [Service]
    Type=forking
    ExecStart=/etc/rc.local
    TimeoutSec=0
    StandardOutput=tty
    RemainAfterExit=yes
    SysVStartPriority=99 
    

     

    Next, reload systemd

    systemctl daemon-reload

     

    Start your new service

    systemctl start my-rc-local

     

    Check the status

    systemctl status my-rc-local

     

    Finally, enable it to run at boot

    systemctl enable my-rc-local

     

    No questions yet.