Skip to content

emka.web.id

Menu
  • Home
  • Indeks Artikel
  • Tutorial
  • Tentang Kami
Menu

Cara Membuat rc.local di Debian 10

Posted on October 30, 2019 by Syauqi Wiryahasana
Debian 10 secara resmi menghapus file rc.local yang biasanya kita gunakan untuk melakukan inisiasi program atau script saat booting secara otomatis. Nah, untuk mengakali hal itu, kita bikin rc.local sendiri dengan membuat systemd unit baru yang menjalankan rc.local tersebut. Silakan ikuti tutorial berikut:
  1. Buat file systemd unit dengan contoh
[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
simpan dengan nama /etc/systemd/system/rc-local.service
  1. lalu bikin file rc.local baru, di /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
  1. Buat file rc.local menjadi executable dengan perintah chmod +x /etc/rc.local
  2. Enable systemd unit dari rc.local dengan systemctl enable rc-local
  3. Start rc-local dengan systemctl start rc-local
Selamat mencoba!
Seedbacklink

Recent Posts

TENTANG EMKA.WEB>ID

EMKA.WEB.ID adalah blog seputar teknologi informasi, edukasi dan ke-NU-an yang hadir sejak tahun 2011. Kontak: kontak@emka.web.id.

©2024 emka.web.id Proudly powered by wpStatically