Linux

Mengaktifkan /etc/rc.local di Ubuntu

Pertama kita create file ini dulu

/etc/systemd/system/rc-local.service

Yang isi nya seperti 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.target

Lalu kita isi file /etc/rc.local dengan barisan perintah yang akan dijalankan saat system baru boot up,k emudian jangan lupa beri permission utk execute (chmod +x)

chmod +x /etc/rc.local

Jika sudah siap, maka langkah berikutnya adalah mengaktifkan rc.local agar selalu dijalankan setiap awal boot up system, dengan perintah berikut:

systemctl enable rc-local

Leave a Reply

Your email address will not be published. Required fields are marked *