Ignore:
Timestamp:
Mar 13, 2014 2:29:41 AM (6 years ago)
Author:
kytv <kytv@…>
Branches:
master
Children:
5d1796b
Parents:
738c5ed
Message:

Debian: Add systemd support (ticket #1208)

Currently just for Debian unstable and Ubuntu Saucy and newer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • debian/i2p.postinst

    r738c5ed rbfba732  
    1 #!/bin/sh  -e
     1#!/bin/sh
     2
     3set -e
    24
    35I2PHOME=/var/lib/i2p
     
    57
    68conffile="/etc/default/i2p"
     9systemdservice="/lib/systemd/system/i2p.service"
    710
    811# Source debconf library -- we have a Depends line
     
    5861        mv -f $conffile.tmp $conffile
    5962
     63        if [ -e "$systemdservice" ]; then
     64            sed -e "s/User=.*/User=$I2PUSER/" < "$systemdservice" > "$systemdservice.tmp"
     65            mv -f "$systemdservice.tmp" "$systemdservice"
     66            chmod 0644 -f "$systemdservice"
     67            if [ -x /bin/systemctl ]; then
     68                    systemctl --system daemon-reload
     69                    if [ $RUN_DAEMON = 'true' ]; then
     70                            systemctl enable i2p.service
     71                    else
     72                            systemctl disable i2p.service
     73                    fi
     74            fi
     75        fi
     76
    6077        sed -e "s/^ *wrapper\.java\.maxmemory=.*/wrapper\.java\.maxmemory=$MEMORYLIMIT/" \
    6178            < /etc/i2p/wrapper.config > /etc/i2p/wrapper.config.tmp
     
    7390            $I2PSYSUSER -e 1 > /dev/null 2>&1 || true
    7491    else
    75         adduser --system --quiet --group --home $I2PHOME $I2PSYSUSER
     92        adduser --system --quiet --group --home $I2PHOME $I2PSYSUSER > /dev/null 2>&1
    7693    fi
    7794
Note: See TracChangeset for help on using the changeset viewer.