2

I'm trying to run this script https://github.com/oblique/create_ap on startup on my RPi with this command: /usr/bin/screen -dmS ap /usr/bin/create_ap -m nat wlan0 eth0 RaspberryAP ******, but it doesn't do anything; it works when starting it manually via ssh, but sadly it's not starting on its own with this command. What did I do wrong?

Still, it doesn't start, but according to /var/log/syslog it also didn't have any errors

  • Where are you trying to start it from? – stevieb Aug 8 '15 at 16:38
  • @stevieb I'm using the /etc/rc.local file (in the line before exit 0) – Simon Aug 8 '15 at 16:39
  • Don't add to /etc/rc.local - that gets run at the end of every runlevel (including well before networking is up and going), suggest new script /etc/rc3.d/S99screen instead – steve Aug 8 '15 at 17:14
  • @steve Should I just add the command or use the skeleton? – Simon Aug 8 '15 at 17:23
2

Create a new startup script instead of adding to /etc/rc.local file. Doesn't have to be anything complicated. Example:

$ cat >/etc/rc3.d/S99screen
#!/bin/bash
/usr/bin/screen -dmS ap /usr/bin/create_ap -m nat wlan0 eth0 RaspberryAP ******
^D
$ chmod 755 /etc/rc3.d/S99screen
$

And then reboot to test.

  • I followed your instructions, but it seems like it's still not doing anything, because I started screen with -L (output logging) and still can't find any logfile – Simon Aug 8 '15 at 17:48
  • I just updated/upgraded with apt-get (for another reason) and when restarting apache, it seems like it's going through the startup scripts again, because there it tells me insserv: warning: script is corrupt or invalid: /etc/init.d/../rc3.d/S99create_ap – Simon Aug 8 '15 at 17:55
  • Oops, sorry, looks like template approach will be needed then. Take an existing script in /etc/rc3.d/, copy it to S99create_ap and edit to have your screen command in there, together with all the template headers. If then works I'll revise my answer accordingly. – steve Aug 8 '15 at 18:42
  • Sadly, that still didn't work; first I tried copying from ### BEGIN INIT INFO to ### END INIT INFO, which did nothing, and the I tried copying the whole file (I copied the cron script) and editing it accordingly (I'm still not sure about the DAEMON option). Didn't work either – Simon Aug 8 '15 at 18:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.