source: trunk/debathena/debathena/dotfiles/debian/debathena-dotfiles.init @ 24222

Revision 24222, 923 bytes checked in by broder, 15 years ago (diff)
In dotfiles: * Don't ship /var/run/athena-sessions as part of the package.
Line 
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides:          athena-sessions-clean
4# Required-Start:    $local_fs
5# Required-Stop:
6# Default-Start:     S
7# Default-Stop:
8# Short-Description: Clean old Athena sessions.
9# Description:       Clean old Athena sessions from /var/run/athena-sessions.
10### END INIT INFO
11
12. /lib/lsb/init-functions
13
14clean_athena_sessions () {
15    cd /var/run/athena-sessions || return 1
16    find . -depth -xdev ! -type d \
17        -print0 | xargs -0r rm -f -- \
18        || return 1
19    find . -depth -xdev -type d ! -name . -empty \
20        -exec rmdir \{\} \; \
21        || return 1
22}
23
24case "$1" in
25    start)
26        if ! [ -e /var/run/athena-sessions ]; then
27            mkdir /var/run/athena-sessions
28            chmod a=rwx,u+t /var/run/athena-sessions
29        fi
30        log_action_begin_msg "Cleaning old Athena sessions"
31        clean_athena_sessions
32        log_action_end_msg $?
33        ;;
34    restart|stop|force-reload)
35        ;;
36    *)
37        echo "Usage: $0 {start}" >&2
38        exit 3
39        ;;
40esac
41
42:
Note: See TracBrowser for help on using the repository browser.