source: trunk/cereal/debian/cereal.postinst @ 1097

Last change on this file since 1097 was 1097, checked in by jrollins, 10 years ago

added lockfile support to close #484980. still needs testing.

  • Property svn:executable set to *
File size: 1010 bytes
Line 
1#!/bin/sh -e
2
3# postinst script for cereal
4
5# Author: Jamie Rollins <jrollins@fifthhorseman.net> and
6#         Daniel Kahn Gillmor <dkg-debian.org@fifthhorseman.net>
7# (c) 2007
8
9if ! getent passwd cereal >/dev/null ; then
10    echo "adding cereal user..."
11    adduser --quiet --system --no-create-home --home '/var/lib/cereal' --shell '/bin/false' --gecos 'cereal logfile owner,,,' cereal
12fi
13
14# apply some needed upgrades to existing sessions
15for session in $(cereal list | cut -d ' ' -f 2) ; do
16
17    # add the 'down' file to all stopped sessions
18    if cereal list "$session" | grep -q '^-' ; then
19        touch /var/lib/cereal/sessions/"$session"/down
20    fi
21
22    # make sure all sessions have the finish script
23    # added for version 0.22
24    ln -sf /usr/share/cereal/finish /var/lib/cereal/sessions/"$session"/finish
25
26done
27
28# restart all running sessions
29cereal-admin restart --running
30
31# dh_installdeb will replace this with shell code automatically
32# generated by other debhelper scripts.
33
34#DEBHELPER#
35
36exit 0
Note: See TracBrowser for help on using the repository browser.