/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to init.d-mandos

  • Committer: Teddy Hogeborn
  • Date: 2009-02-09 02:01:13 UTC
  • Revision ID: teddy@fukt.bsnet.se-20090209020113-726hq380zvp8zt97
Four new interrelated features:

1. Support using a different network interface via both initramfs.conf
   (the DEVICE setting) and the kernel command line (sixth field of
   the "ip=" option as in Linux' Documentation/nfsroot.txt).

2. Support connecting to a specified Mandos server directly using a
   kernel command line option ("mandos=connect:<ADDRESS>:<PORT>").

3. Support connecting directly to an IPv4 address (and port) using the
   "--connect" option of mandos-client.

4. Support an empty string to the --interface option to mandos-client.

* Makefile (WARN): Increase strictness by changing to
                   "-Wstrict-aliasing=1".

* debian/mandos-client.README.Debian (Use the Correct Network
  Interface): Changed to refer to initramfs.conf and nfsroot.txt.
  (Test the Server): Improve wording.
  (Non-local Connection): New section.
* initramfs-tools-script: Obey DEVICE environment variable and setting
                          from "/conf/initramfs.conf".  Also let any
                          "ip=" kernel command line option override
                          it.  Support new "mandos=connect" option.
                          Call "configure_networking" to set up IP
                          address on interface if necessary.
* plugin-runner.conf: Change example.
* plugins.d/mandos-client.c: Some whitespace and comment changes.
  (start_mandos_communication): Take an additional argument for
                                address family, all callers changed.
                                Connect to an IPv4 address if address
                                family is AF_INET.  Only set IPv6
                                scope_id for link-local addresses.
  (main): Accept empty interface name; this will not bring up any
         interface and leave the interface as unspecified.  Also do
         not restore kernel log level if lowering it failed.
* plugins.d/mandos-client.xml (OPTIONS): Document that the
                                         "--interface" option accepts
                                         an empty string.
  (EXAMPLE): Change example IPv6 address to a link-local address.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! /bin/sh
2
2
### BEGIN INIT INFO
3
3
# Provides:          mandos
4
 
# Required-Start:    $remote_fs $syslog avahi-daemon
5
 
# Required-Stop:     $remote_fs $syslog avahi-daemon
 
4
# Required-Start:    $remote_fs avahi-daemon
 
5
# Required-Stop:     $remote_fs
6
6
# Default-Start:     2 3 4 5
7
7
# Default-Stop:      0 1 6
8
8
# Short-Description: Mandos server
9
 
# Description:       Server of encrypted passwords to Mandos clients
 
9
# Description:       Gives encrypted passwords to Mandos clients
10
10
### END INIT INFO
11
11
 
12
 
# Author: Teddy Hogeborn <teddy@recompile.se>
13
 
# Author: Björn Påhlsson <belorn@recompile.se>
 
12
# Author: Teddy Hogeborn <teddy@fukt.bsnet.se>
 
13
# Author: Björn Påhlsson <belorn@fukt.bsnet.se>
 
14
#
 
15
# Please remove the "Author" lines above and replace them
 
16
# with your own name if you copy and modify this script.
14
17
 
15
18
# Do NOT "set -e"
16
19
 
20
23
NAME=mandos
21
24
DAEMON=/usr/sbin/$NAME
22
25
DAEMON_ARGS=""
23
 
if [ -d /run/. ]; then
24
 
    PIDFILE=/run/$NAME.pid
25
 
else
26
 
    PIDFILE=/var/run/$NAME.pid
27
 
fi
 
26
PIDFILE=/var/run/$NAME.pid
28
27
SCRIPTNAME=/etc/init.d/$NAME
29
28
 
30
29
# Exit if the package is not installed
41
40
. /lib/init/vars.sh
42
41
 
43
42
# Define LSB log_* functions.
44
 
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
45
 
# and status_of_proc is working.
 
43
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
46
44
. /lib/lsb/init-functions
47
45
 
48
46
#
120
118
                2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
121
119
        esac
122
120
        ;;
123
 
  status)
124
 
        status_of_proc "$DAEMON" "$NAME" -p "$PIDFILE" && exit 0 || exit $?
125
 
        ;;
126
121
  #reload|force-reload)
127
122
        #
128
123
        # If do_reload() is not implemented then leave this commented out
149
144
                esac
150
145
                ;;
151
146
          *)
152
 
                # Failed to stop
 
147
                # Failed to stop
153
148
                log_end_msg 1
154
149
                ;;
155
150
        esac
156
151
        ;;
157
152
  *)
158
153
        #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
159
 
        echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
 
154
        echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
160
155
        exit 3
161
156
        ;;
162
157
esac