Wednesday, October 9, 2019

rc.local on kali19.3

Based on https://www.linuxbabe.com/linux-server/how-to-enable-etcrc-local-with-systemd A ton of apps don't have systemd scripts.
cat makerc-local.sh
 #!/bin/bash  
 #create a service that runs /etc/rc.local at boot based on  
 #https://www.linuxbabe.com/linux-server/how-to-enable-etcrc-local-with-systemd  
 cat > /etc/systemd/system/rc-local.service <<EOL  
 [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  
 EOL  
 printf '%s\n' '#!/bin/bash' 'exit 0' | tee -a /etc/rc.local  
 systemctl enable rc-local  
 systemctl start rc-local.service  
 systemctl status rc-local.service  

No comments:

Post a Comment