1

I have configured the PPTPD serice on my Pi and it works well.

When I reboot the Pi the PPTPD service is not starting automatically.

When seaching Google there are many ways suggested.

Should I use something like sudo nano /etc/rc.local or upstart?

Please can someone advise which is the best way?

1

If you want to start a service automatically you probably want to use the rc framework.

In /etc/ you will find a number of directories named

/etc/rc0.d
/etc/rc1.d
/etc/rc2.d
/etc/rc3.d
/etc/rc4.d
/etc/rc5.d
/etc/rc6.d

These represent runlevels, and are filled with carefully named soft links to scripts in in /etc/init.d/ directory that are executed in order in different stages of the startup and shutdown processes. The /etc/init.d directory is filled with scripts starting and stopping different services, and one of the scripts you will find there is the pptpd service script.

When you execute a command like service pptpd start, the pptpd script in /etc/init.d is executed with the start argument.

What you want to do is to start the pptpd service at runlevel 2. That means you create a soft link in the /etc/rc2.d-directory named S16pptpd that points to the /etc/init.d/pptpd script, like so:

ln -s /etc/init.d/pptpd /etc/rc2.d/S16pptpd
  • "S" is for "start"
  • "16" is the ordering
  • "pptpd" is a mnemonic

This will make sure that when your system enters runlevel 2, the pptpd service will be started.

  • Hi. Your answer was automatically "flagged as low-quality because of its length and content." Could you improve it to point out what to do and how it works? – Ghanima Jan 22 '16 at 14:48
  • 1
    Thanks, I can see why that would be. Expanded and elaborated the answer slightly. – Bex Jan 24 '16 at 10:29

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.