diff options
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/hpux/README | 26 | ||||
-rw-r--r-- | contrib/hpux/egd | 15 | ||||
-rwxr-xr-x | contrib/hpux/egd.rc | 98 |
3 files changed, 139 insertions, 0 deletions
diff --git a/contrib/hpux/README b/contrib/hpux/README index edddfc018..172a765d2 100644 --- a/contrib/hpux/README +++ b/contrib/hpux/README | |||
@@ -3,9 +3,13 @@ Kevin Steves <stevesk@sweden.hp.com> | |||
3 | 3 | ||
4 | sshd: configuration file for sshd.rc | 4 | sshd: configuration file for sshd.rc |
5 | sshd.rc: SSH startup script | 5 | sshd.rc: SSH startup script |
6 | egd: configuration file for egd.rc | ||
7 | egd.rc: EGD (entropy gathering daemon) startup script | ||
6 | 8 | ||
7 | To install: | 9 | To install: |
8 | 10 | ||
11 | sshd.rc: | ||
12 | |||
9 | o Verify paths in sshd.rc match your local installation | 13 | o Verify paths in sshd.rc match your local installation |
10 | (WHAT_PATH and WHAT_PID) | 14 | (WHAT_PATH and WHAT_PID) |
11 | o Customize sshd if needed (SSHD_ARGS) | 15 | o Customize sshd if needed (SSHD_ARGS) |
@@ -17,3 +21,25 @@ o Install: | |||
17 | # chmod 555 /sbin/init.d/sshd.rc | 21 | # chmod 555 /sbin/init.d/sshd.rc |
18 | # ln -s /sbin/init.d/sshd.rc /sbin/rc1.d/K100sshd | 22 | # ln -s /sbin/init.d/sshd.rc /sbin/rc1.d/K100sshd |
19 | # ln -s /sbin/init.d/sshd.rc /sbin/rc2.d/S900sshd | 23 | # ln -s /sbin/init.d/sshd.rc /sbin/rc2.d/S900sshd |
24 | |||
25 | egd.rc: | ||
26 | |||
27 | o Verify egd.pl path in egd.rc match your local installation | ||
28 | (WHAT_PATH) | ||
29 | o Customize egd if needed (EGD_ARGS and EGD_LOG) | ||
30 | o Add pseudo account: | ||
31 | |||
32 | # groupadd egd | ||
33 | # useradd -g egd egd | ||
34 | # mkdir -p /etc/opt/egd | ||
35 | # chown egd:egd /etc/opt/egd | ||
36 | # chmod 711 /etc/opt/egd | ||
37 | |||
38 | o Install: | ||
39 | |||
40 | # cp egd /etc/rc.config.d | ||
41 | # chmod 444 /etc/rc.config.d/egd | ||
42 | # cp egd.rc /sbin/init.d | ||
43 | # chmod 555 /sbin/init.d/egd.rc | ||
44 | # ln -s /sbin/init.d/sshd.rc /sbin/rc1.d/K600egd | ||
45 | # ln -s /sbin/init.d/sshd.rc /sbin/rc2.d/S400egd | ||
diff --git a/contrib/hpux/egd b/contrib/hpux/egd new file mode 100644 index 000000000..21af0bd13 --- /dev/null +++ b/contrib/hpux/egd | |||
@@ -0,0 +1,15 @@ | |||
1 | # EGD_START: Set to 1 to start entropy gathering daemon | ||
2 | # EGD_ARGS: Command line arguments to pass to egd | ||
3 | # EGD_LOG: EGD stdout and stderr log file (default /etc/opt/egd/egd.log) | ||
4 | # | ||
5 | # To configure the egd environment: | ||
6 | |||
7 | # groupadd egd | ||
8 | # useradd -g egd egd | ||
9 | # mkdir -p /etc/opt/egd | ||
10 | # chown egd:egd /etc/opt/egd | ||
11 | # chmod 711 /etc/opt/egd | ||
12 | |||
13 | EGD_START=1 | ||
14 | EGD_ARGS='/etc/opt/egd/entropy' | ||
15 | EGD_LOG= | ||
diff --git a/contrib/hpux/egd.rc b/contrib/hpux/egd.rc new file mode 100755 index 000000000..919dea725 --- /dev/null +++ b/contrib/hpux/egd.rc | |||
@@ -0,0 +1,98 @@ | |||
1 | #!/sbin/sh | ||
2 | |||
3 | # | ||
4 | # egd.rc: EGD start-up and shutdown script | ||
5 | # | ||
6 | |||
7 | # Allowed exit values: | ||
8 | # 0 = success; causes "OK" to show up in checklist. | ||
9 | # 1 = failure; causes "FAIL" to show up in checklist. | ||
10 | # 2 = skip; causes "N/A" to show up in the checklist. | ||
11 | # Use this value if execution of this script is overridden | ||
12 | # by the use of a control variable, or if this script is not | ||
13 | # appropriate to execute for some other reason. | ||
14 | # 3 = reboot; causes the system to be rebooted after execution. | ||
15 | |||
16 | # Input and output: | ||
17 | # stdin is redirected from /dev/null | ||
18 | # | ||
19 | # stdout and stderr are redirected to the /etc/rc.log file | ||
20 | # during checklist mode, or to the console in raw mode. | ||
21 | |||
22 | umask 022 | ||
23 | |||
24 | PATH=/usr/sbin:/usr/bin:/sbin | ||
25 | export PATH | ||
26 | |||
27 | WHAT='EGD (entropy gathering daemon)' | ||
28 | WHAT_PATH=/opt/perl/bin/egd.pl | ||
29 | WHAT_CONFIG=/etc/rc.config.d/egd | ||
30 | WHAT_LOG=/etc/opt/egd/egd.log | ||
31 | |||
32 | # NOTE: If your script executes in run state 0 or state 1, then /usr might | ||
33 | # not be available. Do not attempt to access commands or files in | ||
34 | # /usr unless your script executes in run state 2 or greater. Other | ||
35 | # file systems typically not mounted until run state 2 include /var | ||
36 | # and /opt. | ||
37 | |||
38 | rval=0 | ||
39 | |||
40 | # Check the exit value of a command run by this script. If non-zero, the | ||
41 | # exit code is echoed to the log file and the return value of this script | ||
42 | # is set to indicate failure. | ||
43 | |||
44 | set_return() { | ||
45 | x=$? | ||
46 | if [ $x -ne 0 ]; then | ||
47 | echo "EXIT CODE: $x" | ||
48 | rval=1 # script FAILed | ||
49 | fi | ||
50 | } | ||
51 | |||
52 | case $1 in | ||
53 | 'start_msg') | ||
54 | echo "Starting $WHAT" | ||
55 | ;; | ||
56 | |||
57 | 'stop_msg') | ||
58 | echo "Stopping $WHAT" | ||
59 | ;; | ||
60 | |||
61 | 'start') | ||
62 | if [ -f $WHAT_CONFIG ] ; then | ||
63 | . $WHAT_CONFIG | ||
64 | else | ||
65 | echo "ERROR: $WHAT_CONFIG defaults file MISSING" | ||
66 | fi | ||
67 | |||
68 | |||
69 | if [ "$EGD_START" -eq 1 -a -x $WHAT_PATH ]; then | ||
70 | EGD_LOG=${EGD_LOG:-$WHAT_LOG} | ||
71 | su egd -c "nohup $WHAT_PATH $EGD_ARGS >$EGD_LOG 2>&1" && | ||
72 | echo $WHAT started | ||
73 | set_return | ||
74 | else | ||
75 | rval=2 | ||
76 | fi | ||
77 | ;; | ||
78 | |||
79 | 'stop') | ||
80 | pid=`ps -fuegd | awk '$1 == "egd" { print $2 }'` | ||
81 | if [ "X$pid" != "X" ]; then | ||
82 | if kill "$pid"; then | ||
83 | echo "$WHAT stopped" | ||
84 | else | ||
85 | rval=1 | ||
86 | echo "Unable to stop $WHAT" | ||
87 | fi | ||
88 | fi | ||
89 | set_return | ||
90 | ;; | ||
91 | |||
92 | *) | ||
93 | echo "usage: $0 {start|stop|start_msg|stop_msg}" | ||
94 | rval=1 | ||
95 | ;; | ||
96 | esac | ||
97 | |||
98 | exit $rval | ||