Site icon Learning & Doing

Membuat rc.local Pada Debian 9

1. Edit file /etc/systemd/system/rc-local.service

# nano /etc/systemd/system/rc-local.service
[Unit]
Description=/etc/rc.local
ConditionPathExists=/etc/rc.local

[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
SysVStartPriority=99

[Install]
WantedBy=multi-user.target

2. Edit the “rc.local” file :

# nano /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 0

3. Ubah izin akses

# chmod +x /etc/rc.local

4. Hidupkan rc-local pada saat boot :

# systemctl enable rc-local

5. Jalankan script rc-local :

# systemctl start rc-local.service

6. Periksa jika ada error pada saat memulai :

# systemctl status rc-local.service
Exit mobile version