Systemd dan rc.local di IGOS Nusantara: Perbedaan revisi
Dari IGNwiki
Baris 9: | Baris 9: | ||
#!/bin/bash | #!/bin/bash | ||
date +"%Y-%m-%d_%T" > /home/cetak-menit/00-tanggal.txt | date +"%Y-%m-%d_%T" > /home/cetak-menit/00-tanggal.txt | ||
+ | |||
+ | Buat berkas /etc/cron.d/1menit | ||
+ | SHELL=/bin/bash | ||
+ | PATH=/sbin:/bin:/usr/sbin:/usr/bin | ||
+ | MAILTO=bantuan@igos-nusantara.or.id | ||
+ | HOME=/ | ||
+ | */1 * * * * root date >> /home/cetak-menit/`cat /home/cetak-menit/00-tanggal.txt`.1menit | ||
Periksa status rc-local | Periksa status rc-local | ||
Baris 14: | Baris 21: | ||
rc-local.service - /etc/rc.d/rc.local Compatibility | rc-local.service - /etc/rc.d/rc.local Compatibility | ||
Loaded: loaded (/usr/lib/systemd/system/rc-local.service; static) | Loaded: loaded (/usr/lib/systemd/system/rc-local.service; static) | ||
− | Active: active (exited) since Thu, 28 Mar 2013 15:43:02 +0700; 12min ago | + | Active: '''active''' (exited) since Thu, 28 Mar 2013 15:43:02 +0700; 12min ago |
CGroup: name=systemd:/system/rc-local.service | CGroup: name=systemd:/system/rc-local.service |
Revisi per 28 Maret 2013 08.58
IGOS Nusantara 7 dan 8 memakai systemd. Pada systemd secara default rc.local tidak dibuat.
Buat berkas /etc/rc.d/rc.local dan beri hak akses 755
# touch /etc/rc.d/rc.local # chmod 755 /etc/rc.d/rc.local # mkdir -p /home/cetak-menit/
Isi berkas /etc/rc.d/rc.local sebagai berikut
#!/bin/bash date +"%Y-%m-%d_%T" > /home/cetak-menit/00-tanggal.txt
Buat berkas /etc/cron.d/1menit
SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=bantuan@igos-nusantara.or.id HOME=/ */1 * * * * root date >> /home/cetak-menit/`cat /home/cetak-menit/00-tanggal.txt`.1menit
Periksa status rc-local
# systemctl status rc-local.service rc-local.service - /etc/rc.d/rc.local Compatibility Loaded: loaded (/usr/lib/systemd/system/rc-local.service; static) Active: active (exited) since Thu, 28 Mar 2013 15:43:02 +0700; 12min ago CGroup: name=systemd:/system/rc-local.service