~vcs-imports/ipfire/ipfire-2.x

« back to all changes in this revision

Viewing changes to src/initscripts/init.d/sshd

  • Committer: Daniel Glanzmann
  • Date: 2008-09-26 17:05:28 UTC
  • mto: (1394.1.12)
  • mto: This revision was merged to the branch mainline in revision 1401.
  • Revision ID: git-v1:19ac4d1b6e234e1391b3d406381e3b74e92c40dd
added new useragent thunderbird

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
# Begin $rc_base/init.d/sshd
 
3
 
 
4
# Based on sysklogd script from LFS-3.1 and earlier.
 
5
# Rewritten by Gerard Beekmans  - gerard@linuxfromscratch.org
 
6
 
 
7
#$LastChangedBy: bdubbs $
 
8
#$Date: 2006-04-15 17:34:16 -0500 (Sat, 15 Apr 2006) $
 
9
 
 
10
. /etc/sysconfig/rc
 
11
. $rc_functions
 
12
 
 
13
case "$1" in
 
14
    start)
 
15
                [ -e "/var/ipfire/remote/enablessh" ] || exit 0 # SSH is not enabled
 
16
        boot_mesg "Starting SSH Server..."
 
17
        # Also prevent ssh from being killed by out of memory conditions
 
18
        loadproc /usr/sbin/sshd 
 
19
        sleep 3
 
20
        echo "-16" >/proc/`cat /var/run/sshd.pid`/oom_adj
 
21
        ;;
 
22
 
 
23
    stop)
 
24
        boot_mesg "Stopping SSH Server..."
 
25
        killproc /usr/sbin/sshd
 
26
        ;;
 
27
 
 
28
    reload)
 
29
        boot_mesg "Reloading SSH Server..."
 
30
        reloadproc /usr/sbin/sshd
 
31
        ;;
 
32
 
 
33
    restart)
 
34
        $0 stop
 
35
        sleep 1
 
36
        $0 start
 
37
        ;;
 
38
 
 
39
    status)
 
40
        statusproc /usr/sbin/sshd
 
41
        ;;
 
42
 
 
43
    *)
 
44
        echo "Usage: $0 {start|stop|reload|restart|status}"
 
45
        exit 1
 
46
        ;;
 
47
esac
 
48
 
 
49
# End $rc_base/init.d/sshd