Ubuntu: rc.local di ubuntu 18.04: Difference between revisions
From OnnoCenterWiki
Jump to navigationJump to search
Onnowpurbo (talk | contribs) Created page with "Sumber: https://vpsfix.com/community/server-administration/no-etc-rc-local-file-on-ubuntu-18-04-heres-what-to-do/ The /etc/rc.local files on Ubuntu and Debian systems are u..." |
Onnowpurbo (talk | contribs) |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 2: | Line 2: | ||
Di Ubuntu 18.04, rc.local di tiadakan. Kita dapat membuatnya dengan mengedit file, | |||
nano /etc/rc.local | |||
vi /etc/rc.local | |||
Paste kalimat berikut, | |||
Paste | |||
#!/bin/sh -e | #!/bin/sh -e | ||
| Line 26: | Line 24: | ||
exit 0 | exit 0 | ||
Perintah di atas adalah isi /etc/rc.local di Ubuntu 16.04. Buat supaya bisa di execute, | |||
chmod +x /etc/rc.local | chmod +x /etc/rc.local | ||
Masukan perintah yang di inginkan sebelum kalimat "exit 0" | |||
==Contoh Entry rc.local== | |||
# By default this script does nothing. | |||
/sbin/ifconfig enp2s0 down | |||
/sbin/ifconfig enp3s0 down | |||
/sbin/ifconfig enp2s0 192.168.0.252 | |||
/sbin/ifconfig enp3s0 192.168.0.253 | |||
/sbin/ifconfig enp2s0 up | |||
/sbin/ifconfig enp3s0 up | |||
sleep 10 | |||
/sbin/dhclient enp3s0 | |||
/sbin/dhclient enp2s0 | |||
/etc/init.d/smbd restart | |||
/etc/init.d/nfs-kernel-server restart | |||
/usr/bin/utserver -settingspath /opt/utorrent-server-alpha-v3_3/ -daemon | |||
exit 0 | |||
| Line 38: | Line 58: | ||
* https://vpsfix.com/community/server-administration/no-etc-rc-local-file-on-ubuntu-18-04-heres-what-to-do/ | * https://vpsfix.com/community/server-administration/no-etc-rc-local-file-on-ubuntu-18-04-heres-what-to-do/ | ||
==Pranala Menarik== | |||
* [[Ubuntu: rc.local di ubuntu 20.04]] | |||
Latest revision as of 04:05, 7 March 2021
Di Ubuntu 18.04, rc.local di tiadakan. Kita dapat membuatnya dengan mengedit file,
nano /etc/rc.local vi /etc/rc.local
Paste kalimat berikut,
#!/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
Perintah di atas adalah isi /etc/rc.local di Ubuntu 16.04. Buat supaya bisa di execute,
chmod +x /etc/rc.local
Masukan perintah yang di inginkan sebelum kalimat "exit 0"
Contoh Entry rc.local
# By default this script does nothing. /sbin/ifconfig enp2s0 down /sbin/ifconfig enp3s0 down /sbin/ifconfig enp2s0 192.168.0.252 /sbin/ifconfig enp3s0 192.168.0.253 /sbin/ifconfig enp2s0 up /sbin/ifconfig enp3s0 up sleep 10 /sbin/dhclient enp3s0 /sbin/dhclient enp2s0 /etc/init.d/smbd restart /etc/init.d/nfs-kernel-server restart /usr/bin/utserver -settingspath /opt/utorrent-server-alpha-v3_3/ -daemon exit 0