critak
Posts: 6
Joined: Wed Feb 26, 2014 8:27 am

Change order of auto-starting services (sshd)

Sun Jun 08, 2014 9:46 pm

Hey i want to let sshd start earlier than a certain other service (open vpn) !

Last week i change the settings of my openvpn connection and accidentally added a profile that requires a password.
So i was not able to connect via ssh because sshd was not started and openvpn was blocking the boot up because it was waiting for the password.

i don't want this happen again. so i want to start sshd before openvpn.

i found out that i have to look in /etc/rc*. but i can't find sshd.

How can i manage that?

thanks !

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Change order of auto-starting services (sshd)

Sun Jun 08, 2014 10:16 pm

Change this stuff in /etc/init.d/ssh

Code: Select all

#! /bin/sh

### BEGIN INIT INFO
# Provides:             sshd
# Required-Start:       $remote_fs $syslog
# Required-Stop:        $remote_fs $syslog
# Default-Start:        2 3 4 5
# Default-Stop:
# Short-Description:    OpenBSD Secure Shell server
### END INIT INFO
and /etc/init.d/openvpn

Code: Select all

#!/bin/sh -e

### BEGIN INIT INFO
# Provides:          openvpn
# Required-Start:    $network $remote_fs $syslog
# Required-Stop:     $network $remote_fs $syslog
# Should-Start:      network-manager
# Should-Stop:       network-manager
# X-Start-Before:    $x-display-manager gdm kdm xdm wdm ldm sdm nodm
# X-Interactive:     true
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Openvpn VPN service
# Description: This script will start OpenVPN tunnels as specified
#              in /etc/default/openvpn and /etc/openvpn/*.conf
### END INIT INFO
Then use update-rc.d to move the order that your /etc/rc*.d scripts get run.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Return to “Raspberry Pi OS”