Sysadmin
Mengaktifkan file rc.local pada Ubuntu
Ubuntu is now using systemd, and rc.local is now considered a service which is turned "off" by default. You can turn rc.local "on" by entering the following command and rebooting:
Mengaktifkan rc.local pada Ubuntu dengan systemd
Ubuntu modern menggunakan systemd sebagai init system. Oleh karena itu, rc.local kini diperlakukan sebagai sebuah service dan dalam kondisi disabled secara default.
Untuk mengaktifkan kembali rc.local, jalankan perintah berikut:
sudo systemctl enable rc-local.service
Kemudian reboot sistem agar perubahan diterapkan:
sudo reboot
Verifikasi Status Service
Untuk memastikan service sudah aktif:
sudo systemctl status rc-local.service
Catatan
Pada beberapa versi Ubuntu, Anda juga perlu memastikan bahwa file /etc/rc.local:
- Sudah tersedia.
- Memiliki permission executable.
- Berisi perintah yang ingin dijalankan saat booting.
Contoh:
sudo chmod +x /etc/rc.local
Contoh isi /etc/rc.local:
#!/bin/bash
# Perintah yang dijalankan saat startup
echo "Startup script executed"
exit 0
Setelah konfigurasi selesai, reboot sistem untuk menguji apakah script berjalan otomatis saat startup.
ubuntu
Published by Nirantara
Nirantara is an Indonesian Enterprise AI company specializing in Enterprise AI, RAG, Intelligent Search, and AI Automation. Article written by andre.