/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: 2024-09-09 04:24:39 UTC
  • Revision ID: teddy@recompile.se-20240909042439-j85mr20uli2hnyis
Eliminate compiler warnings

Many programs use nested functions, which now result in a linker
warning about executable stack.  Hide this warning.  Also, rewrite a
loop in the plymouth plugin to avoid warning about signed overflow.
This change also makes the plugin pick the alphabetically first
process entry instead of the last, in case many plymouth processes are
found (which should be unlikely).

* Makefile (plugin-runner, dracut-module/password-agent,
  plugins.d/password-prompt, plugins.d/mandos-client,
  plugins.d/plymouth): New target; set LDFLAGS to add "-Xlinker
  --no-warn-execstack".
* plugins.d/plymouth.c (get_pid): When no pid files are found, and we
  are looking through the process list, go though it from the start
  instead of from the end, i.e. in normal alphabetical order and not
  in reverse order.

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