1

I have a script inside of /etc/init.d/wifi and I want to start it on boot. I first gave it permissions by running sudo chmod 755 wifi, then I ran sudo update-rc.d wifi defaults. Finally, I enabled it with wifi enable and it worked perfectly. However, when I did a reboot, the service wasn't active.

Why? What am I missing? I'm using Debian 9.

1
  • 2
    Are you actually using van Smoorenburg rc? Or are you using systemd? If the latter, your question should contain the output of systemctl status wifi. In either case, your question should also show the descriptive comment block in the script, that is usually at the beginning. Commented Apr 30, 2020 at 20:01

3 Answers 3

1

First, tell systemd about the service:

systemctl daemon-reload

This should create a mapping from your initV startup to a systemd unit file. Now you should get some sensible output when you run....

systemctl status wifi

You will probably need to enable the service:

systemctl enable wifi

Although this does not address the complexities of ensuring it is started at the right point during initialization - i.e. before services which rely on the network. Indeed its very unusual to start the network up this way. Typically there is another layer of abstraction between systemd and the network handled by ifupdown, networkManager or similar.

0

I think you forgot to create a symlink to /etc/rc.d

See Jonathan Muller's answer to this exact question over on stack overflow

1
  • The question said that the questioner ran update-rc.d. Commented Apr 30, 2020 at 19:56
-1

update-rc.d sysinit is the old-style fashion to deal with services @boot time.

Now you need to deal with .

You can create a systemd script.

Another 'hack' is to add your script to /etc/rc.local, that way, it will be executed at boot time.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.