Laman

Senin, 05 November 2018

Mengaktifkan rc.local di Debian 9 (Stretch)

 
Cara memberikan rc local di debian 9, yang mana kita harus manual memberikan dan mengaktifkan rc local sangat berbeda di debian versi sebelum sebelumnya...langsung saja kita praktekkan langkah demi langkah ::

1. Tambahkan direktory rc-local.service di /etc/sytemd/system/
#cd /etc/sytemd/system/
#nano /rc-local.service
isikan script dibawah ini
[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. tambahkan script dibawah ini di lokasi rc.local
#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. Berikan hak akses x untuk exsekusi di file rc.local
#chmod +x /etc/rc.local
====================================================================
4. Perintah untuk mengaktifkan rc-local ketika booting
#systemctl enable rc-local
====================================================================
5. Perintah untuk menjalankan script rc-local
#systemctl start rc-local.service
====================================================================
6. Cek status rc-local.service
#systemctl status rc-local.service
------------------------------------------------------------------------------------------------------
hasilnya
root@debian9putut:/home/putut# systemctl status rc-local.service
? rc-local.service - /etc/rc.local
   Loaded: loaded (/etc/systemd/system/rc-local.service; enabled; vendor

preset:
  Drop-In: /lib/systemd/system/rc-local.service.d
           +-debian.conf
   Active: active (exited) since Mon 2018-11-05 02:01:13 EST; 13s ago
  Process: 1052 ExecStart=/etc/rc.local start (code=exited,

status=0/SUCCESS)

Nov 05 02:01:13 debian9putut systemd[1]: Starting /etc/rc.local...
Nov 05 02:01:13 debian9putut systemd[1]: Started /etc/rc.local.
====================================================================
7. Tambahkan script dibawah ini di file rc.local untuk klien agar bisa

berinternet ria
#!/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.
iptables -t nat -A POSTROUTING -j MASQUERADE
exit 0



Related Posts:

0 komentar:

Posting Komentar

www.lowongankerjababysitter.com www.lowongankerjapembanturumahtangga.com www.lowonganperawatlansia.com www.lowonganperawatlansia.com www.yayasanperawatlansia.com www.penyalurpembanturumahtanggaku.com www.bajubatikmodernku.com www.bestdaytradingstrategyy.com www.paketpernikahanmurahjakarta.com www.paketweddingorganizerjakarta.com www.undanganpernikahanunikmurah.com