Start script at boot (feat. rc.local)

Semidragon·2023년 3월 29일
0

Ubuntu Basics

목록 보기
6/8
post-thumbnail

To enable SR-IOV VFs at every boot, or to set routing information, setting specific commands at boot was needed, and this was able to automize uzing "rc.local"

1. See rc.local enabled

systemctl status rc-local.service

It is inactive for now

2. Make rc.local

printf '%s\n' '#!/bin/bash' 'exit 0' | sudo tee -a /etc/rc.local sudo

3. Make rc.local executable

sudo chmod +x /etc/rc.local

4. Edit rc-local.service

sudo vim /lib/systemd/system/rc-local.service

# Add at end
[Install]
WantedBy=multi-user.target

5. Enable && Start rc-local

sudo systemctl enable rc-local.service
sudo systemctl start rc-local.service

6. Edit rc.local

sudo vim /etc/rc.local

#add stuffs like:
route add default gw 8.8.8.8
profile
Semidragon's network [CS undergrad @ Sungkyunkwan University | Networks + System @ CSI]

0개의 댓글