Thursday, January 11, 2018

Ubuntu 17.04 (rc.local) : ubuntu 17.04 /etc/rc.local set

Configure /etc/rc.local in ubuntu 17.04

Due to systemd , the default /etc/rc.local not exists in ubuntu 17.04 .

If you want to make /etc/rc.local execute at the boot time.


You need create a service /etc/systemd/system/rc.local.service
 
[Unit]
Description=/etc/rc.local Compatibility
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


And create a file /etc/rc.local
 
#!/bin/sh
echo  deadline > /sys/block/sda/queue/scheduler


Enable and start service, then check it status

systemctl enable rc.local.service

systemctl start rc.local.service

systemctl status rc.local.service

No comments: