Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Maalepaaler
mp-rude
Commits
afcec7a4
Commit
afcec7a4
authored
Feb 21, 2019
by
Kolbjørn Barmen
Browse files
More pidsfile cleanup
parent
4dd26572
Changes
4
Hide whitespace changes
Inline
Side-by-side
build.sh
View file @
afcec7a4
...
...
@@ -8,7 +8,7 @@ apt-get update
apt-get
-y
upgrade
package
=
"mp-rude"
version
=
"1.3.
6
"
version
=
"1.3.
7
"
#version=$(git describe|perl -p -e 'chomp;s/v([^-]+)(-(\d+)-g.+)?$/\1+\3/;s/\+$//')
...
...
mp-rude/usr/share/mp-rude/start.sh
View file @
afcec7a4
#! /bin/sh
#! /bin/sh
set
-e
.
/etc/mp-rude/start.conf
log
=
"
${
logpath
}
"
/
"
${
date
}
"
/
"traceroute_
$1
"
pidfile
=
${
pidfile
:-
/run/mp-rude.pids
}
if
[
-f
"
${
pidfile
}
"
]
;
then
...
...
mp-rude/usr/share/mp-rude/stop.sh
View file @
afcec7a4
...
...
@@ -4,9 +4,11 @@ set -e
.
/etc/mp-rude/start.conf
if
[
!
-e
"
${
logpath
}
"
/pids
]
pidfile
=
${
pidfile
:-
/run/mp-rude.pids
}
if
[
!
-e
"
${
pidfile
}
"
]
then
echo
"Pid file does not exist:
${
logpath
}
/pids
"
echo
"Pid file does not exist:
${
pidfile
}
"
exit
fi
...
...
@@ -14,13 +16,13 @@ if test $1. != . ; then
sleep
$1
# wait a few seconds closer to midnight
fi
for
pid
in
$(
cat
"
${
logpath
}
"
/pids
)
;
do
for
pid
in
$(
cat
"
${
pidfile
}
"
)
;
do
if
[
-d
/proc/
"
${
pid
}
"
]
;
then
grep
-q
trace.sh /proc/
"
${
pid
}
"
/cmdline
&&
kill
${
pid
}
fi
done
rm
-f
"
${
logpath
}
"
/pids
rm
-f
"
${
pidfile
}
"
# remove empty directories
# remove empty directories
find
"
${
logpath
}
"
-type
d
-empty
-delete
mp-rude/usr/share/mp-rude/trace.sh
View file @
afcec7a4
...
...
@@ -4,6 +4,7 @@ set -e
umask
0002
.
/etc/mp-rude/start.conf
pidfile
=
${
pidfile
:-
/run/mp-rude.pids
}
mkdir
-p
"
${
logpath
}
"
/
"
${
date
}
"
log
=
"
${
logpath
}
"
/
"
${
date
}
"
/
"traceroute_
$1
"
...
...
@@ -23,6 +24,6 @@ fi
sleep
60
done
#) 9> $log.lock &
#echo "$!" >> $
logpath/pids
#echo "$!" >> $
{pidfile}
rmdir
--ignore-fail-on-non-empty
"
${
logpath
}
"
/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment