How to Enable /etc/rc.local with Systemd
"ORANG_MILITER"
Senin 06/November/2017, jika anda menjalankan distro Linux yang menggunakan systemd, mungkin menemukan perintah di file /etc/er.local tidak berjalan. jadi Apa solusinya? ya kita membuat sendiri file /etc/rc.local, berikut caranya :
sudo systemctl status rc-local
akan muncul
Buat file rc-local.service
Sumber : https://askubuntu.com/questions/886620/how-can-i-execute-command-on-startup-rc-local-alternative-on-ubuntu-16-10
The unit files have no [Install] section. They are not meant to be enabled using systemctl. Possible reasons for having this kind of units are: 1) A unit may be statically enabled by being symlinked from another unit's .wants/ or .requires/ directory. 2) A unit's purpose may be to act as a helper for some other unit which has a requirement dependency on it. 3) A unit may be started when needed via activation (socket, path, timer, D-Bus, udev, scripted systemctl call, ...).Solusinya :
Buat file rc-local.service
sudo vi /etc/systemd/system/rc-local.servicetambahkan conten berikut :
[Unit] Description=/etc/rc.local Compatibility ConditionPathExists=/etc/rc.local [Service] Type=forking ExecStart=/etc/rc.local start TimeoutSec=0 StandardOutput=tty RemainAfterExit=yes SysVStartPriority=99 [Install] WantedBy=multi-user.targetSimpan dan buat file /etc/rc.local dan ketikan perintah chmod +x /etc/rc.local
#!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By default this script does nothing. exit 0Aktifkan Service :
sudo systemctl enable rc-localStart service dan cek status :
sudo systemctl start rc-local.service sudo systemctl status rc-local.service
Sumber : https://askubuntu.com/questions/886620/how-can-i-execute-command-on-startup-rc-local-alternative-on-ubuntu-16-10