Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

After writing a startup script, shutdown is delayed

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
calkekecal
Posts: 8
Joined: 2017-07-22 09:22

After writing a startup script, shutdown is delayed

#1 Post by calkekecal »

After writing the below script, putting it into /etc/init.d, I entered following commands to terminal:

sudo chmod +x /etc/init.d/macchanger.sh
sudo chown root:root /etc/init.d/macchanger.sh
sudo update-rc.d macchanger.sh defaults
sudo update-rc.d macchanger.sh enable

However now when I shutdown it gives two errors: "A stop job is running for LSB: macchanger.sh
A start job is running for Network Manager.

What can be the problem?

SCRIPT:

#!/bin/sh
### BEGIN INIT INFO
# Provides: macchanger.sh
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Change MAC on every boot
# Description: macchanger.sh
### END INIT INFO
sudo ip link set wlp3s0 down
sudo service network-manager stop
sudo macchanger -r wlp3s0
sudo ip link set wlp3s0 up
sudo service network-manager start

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: After writing a startup script, shutdown is delayed

#2 Post by debiman »

first of all you should remove all sudo from that script - it is executed as root anyhow.

i think you should make this script into a systemd service instead.

i don't think an init script should contain commands to start/stop other init scripts, doesn't matter whether it's systemd or sysvinit.

Post Reply