diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2016-12-04 14:50:56 +0100 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2016-12-04 15:07:52 +0100 |
commit | 5eebb2d08f9f13511c6d0a1b6f3efdf18077b58a (patch) | |
tree | b370428bbb8ebea9bee50c6026508dec025cca90 /main/backuppc | |
parent | 381dcede14c1ad64e6734a8a6141cc56c9ade7d4 (diff) | |
download | aports-5eebb2d08f9f13511c6d0a1b6f3efdf18077b58a.tar.bz2 aports-5eebb2d08f9f13511c6d0a1b6f3efdf18077b58a.tar.xz |
main/backuppc: rewrite runscript and fix pidfile location
Diffstat (limited to 'main/backuppc')
-rw-r--r-- | main/backuppc/APKBUILD | 10 | ||||
-rw-r--r-- | main/backuppc/backuppc.initd | 53 | ||||
-rw-r--r-- | main/backuppc/fix-pidfile-path.patch | 35 |
3 files changed, 58 insertions, 40 deletions
diff --git a/main/backuppc/APKBUILD b/main/backuppc/APKBUILD index 1f0d0bb37b..ebe849aaa0 100644 --- a/main/backuppc/APKBUILD +++ b/main/backuppc/APKBUILD @@ -16,6 +16,7 @@ install="$pkgname.pre-install" source="http://downloads.sourceforge.net/project/$pkgname/$pkgname/$pkgver/$_realname-$pkgver.tar.gz configure.pl.patch remove-deprecated-perl-defined-at.patch + fix-pidfile-path.patch backuppc.initd" builddir="$srcdir/$_realname-$pkgver" @@ -73,12 +74,15 @@ package() { md5sums="5efdcdd48e9e0d4ef7a706902d1f8b3d BackupPC-3.3.1.tar.gz 2a25b036d273ea67b69aa62e4cd7c28f configure.pl.patch eaff2abac13ea00427e9c895e0dc881c remove-deprecated-perl-defined-at.patch -f0e269be36032f47a7121dea03f69d55 backuppc.initd" +c95caf4db25e308defdcf6dae1662006 fix-pidfile-path.patch +59aba6f5819ca9a620342a8678325794 backuppc.initd" sha256sums="c9cc4aec28a7474a68d40f4bc460ff15140e05c96900c7f98ff3ef06c4f6ae4c BackupPC-3.3.1.tar.gz 86988fbe8e8763abee8861f5bb03bf6bb7fd2430623f78fc921502b6759ad48d configure.pl.patch 202cb3b03bccd3f2af97db737e67ed8daf2a015ca0bb86b8908d8b5cee9ae9db remove-deprecated-perl-defined-at.patch -c466c91f064be2cf3d2ac991a70aee9fc5e19ea12014de0e98a090438cbb81ae backuppc.initd" +6e5e33e0f30b8259ae097e2b5ede9b9864765b3bf4a30c85f37df5f929332c76 fix-pidfile-path.patch +5d270ac3c4ed573a61836b0185eb2cac97116a86a5f65f593bf1c2a124f21867 backuppc.initd" sha512sums="b6bb9de3103c5062098d80755055b7461ae9133a4a46a66b3d0af89d081086571694db1898e7d85880defa15b030bad522812116ae5361c0fbde90b877d139c6 BackupPC-3.3.1.tar.gz a38361fd0e54a4c0100a7bf94b09483e5ba246dc45d6955d275542dd5662d8da11d9580685195b7d4dfa9a07c0487a52a14a95340737e70889ffe5c5e26d5ff8 configure.pl.patch f834c223fd14db6401d0eb162d7794dcc9d040d397f914386769bc3dd82209078c6d0dc331ee1d8943a8ea07ad8c2975929511617b2cd85e85db4f5bbd5fff09 remove-deprecated-perl-defined-at.patch -bb42e0b8524d6c53a39167985ce1bb42c5cb8c074963d3b270c1cff31db5aedc09b8eb27cd7aed7ccd8d27be0b40c43a59dcfbc0637755893af1f84874f67162 backuppc.initd" +15fdb58e038160775fe4deebf6c8adbc128a37da2a866ef00e1eea202c396220cdd1c0547a45f11127dbdc957eaed5188cb87a05467d25647fb462be28c51ce7 fix-pidfile-path.patch +288bba10ca4dd585638625321395e0a40aca30169a122c443f7c6fcd55143e6fcdfa5d39595bacf06cc4960b6e17992a57ec3d3a7ddd9b140e44da4ebdd019d3 backuppc.initd" diff --git a/main/backuppc/backuppc.initd b/main/backuppc/backuppc.initd index 6c43d9874b..751f04bf4e 100644 --- a/main/backuppc/backuppc.initd +++ b/main/backuppc/backuppc.initd @@ -1,47 +1,26 @@ #!/sbin/openrc-run -BACKUPPC_BINDIR=/usr/share/BackupPC/bin -DAEMON=BackupPC -BACKUPPC_LOGDIR=/var/log/BackupPC -USER=backuppc - -depend() { - after firewall modules -} +extra_started_commands="reload" -configure () { - chown $USER $BACKUPPC_LOGDIR - chmod a+x $BACKUPPC_BINDIR/* - test -x $BACKUPPC_BINDIR/$DAEMON || exit 0 -} +: ${user:="backuppc"} +: ${logdir:="/var/log/BackupPC"} +: ${command_args:="-d"} -start() { - ebegin "Starting $DAEMON" - start-stop-daemon --start --pidfile $BACKUPPC_LOGDIR/BackupPC.pid \ - --user $USER --exec $BACKUPPC_BINDIR/$DAEMON -- -d - eend $? -} +command="/usr/share/BackupPC/bin/BackupPC" +start_stop_daemon_args="--interpreted --user $user" +pidfile="/run/BackupPC/BackupPC.pid" +retry="30" -stop () { - ebegin "Stopping $DAEMON" - start-stop-daemon --stop --pidfile $BACKUPPC_LOGDIR/BackupPC.pid \ - --retry 30 -x /usr/bin/perl - eend $? +depend() { + after firewall modules } -restart () { - start-stop-daemon --stop --pidfile $BACKUPPC_LOGDIR/BackupPC.pid \ - --retry 30 -x /usr/bin/perl - start-stop-daemon --start --pidfile $BACKUPPC_LOGDIR/BackupPC.pid \ - --user $USER --exec $BACKUPPC_BINDIR/$DAEMON -- -d +start_pre() { + checkpath -d -o $user -m 755 "${pidfile%/*}" } -reload () { - start-stop-daemon --stop --pidfile $BACKUPPC_LOGDIR/BackupPC.pid \ - --signal 1 -x /usr/bin/perl +reload() { + ebegin "Reloading $name" + start-stop-daemon --signal 1 --pidfile "$pidfile" -x /usr/bin/perl + eend $? } - - - - - diff --git a/main/backuppc/fix-pidfile-path.patch b/main/backuppc/fix-pidfile-path.patch new file mode 100644 index 0000000000..ad76a53961 --- /dev/null +++ b/main/backuppc/fix-pidfile-path.patch @@ -0,0 +1,35 @@ +--- a/bin/BackupPC ++++ b/bin/BackupPC +@@ -363,11 +363,11 @@ + # Write out our initial status and save our PID + # + StatusWrite(); +- unlink("$LogDir/BackupPC.pid"); +- if ( open(PID, ">", "$LogDir/BackupPC.pid") ) { ++ unlink("/run/backuppc/BackupPC.pid"); ++ if ( open(PID, ">", "/run/backuppc/BackupPC.pid") ) { + print(PID $$); + close(PID); +- chmod(0444, "$LogDir/BackupPC.pid"); ++ chmod(0444, "/run/backuppc/BackupPC.pid"); + } + + # +@@ -1846,7 +1846,7 @@ + close(LOG); + LogFileOpen(); + print(LOG "Fatal error: unhandled signal $SigName\n"); +- unlink("$LogDir/BackupPC.pid"); ++ unlink("/run/backuppc/BackupPC.pid"); + confess("Got new signal $SigName... quitting\n"); + } else { + $SigName = shift; +@@ -1968,7 +1968,7 @@ + } + delete($Info{pid}); + StatusWrite(); +- unlink("$LogDir/BackupPC.pid"); ++ unlink("/run/backuppc/BackupPC.pid"); + exit(1); + } + |