Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0ac62b6e9a | ||
|
|
795ed0feaa | ||
|
|
c6456ba7d3 | ||
|
|
a101cfe1c0 |
4
Makefile
4
Makefile
@@ -8,7 +8,7 @@
|
|||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
DEPENDS = dash,kmod,perl,procps-ng,sysvinit
|
DEPENDS = dash,grep,kmod,perl,procps-ng,sed,sysvinit
|
||||||
ARCH = x86_64
|
ARCH = x86_64
|
||||||
URL = http://snaplinux.org
|
URL = http://snaplinux.org
|
||||||
REPO = core
|
REPO = core
|
||||||
@@ -18,7 +18,7 @@ DESC = This package supplies the core required init scripts for startup
|
|||||||
ARCHIVE := ''
|
ARCHIVE := ''
|
||||||
SRCDIR := $(PWD)/SRC/initscripts
|
SRCDIR := $(PWD)/SRC/initscripts
|
||||||
PATCHDIR := $(PWD)/SRC/patches
|
PATCHDIR := $(PWD)/SRC/patches
|
||||||
VERSION := 1.9-0
|
VERSION := 1.12-0
|
||||||
|
|
||||||
include /usr/share/snap/Makefile.snaplinux
|
include /usr/share/snap/Makefile.snaplinux
|
||||||
|
|
||||||
|
|||||||
@@ -187,15 +187,52 @@ status_of_proc() {
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Here we use LSB as a reference for the return values:
|
||||||
|
#
|
||||||
|
# 0 program is running or service is OK
|
||||||
|
# 1 program is dead and /var/run pid file exists
|
||||||
|
# 2 program is dead and /var/lock lock file exists
|
||||||
|
# 3 program is not running
|
||||||
|
# 4 program or service status is unknown
|
||||||
|
# 5-99 reserved for future LSB use
|
||||||
|
# 100-149 reserved for distribution use
|
||||||
|
# 150-199 reserved for application use
|
||||||
|
# 200-254 reserved
|
||||||
|
#
|
||||||
|
# As you can see however, for now we just support 0, 1, 3 and 4
|
||||||
|
# May do something for 2 at some point, but the other status
|
||||||
|
# codes should not be used here - they're only here for reference
|
||||||
|
|
||||||
if [ -n "$pidfile" ]; then
|
if [ -n "$pidfile" ]; then
|
||||||
pid=$(pidofproc -p "$pidfile" "$pathname");
|
if [ -r "$pidfile" ]; then
|
||||||
|
pid=$(pidofproc -p "$pidfile" "$pathname")
|
||||||
|
|
||||||
|
if [ "$?" -eq 0 ]; then
|
||||||
|
echo "$NAME running with PID: $pid" && return 0
|
||||||
|
else
|
||||||
|
echo "$NAME is not running" && return 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
pid=$(pidofproc "$pathname")
|
||||||
|
|
||||||
|
if [ "$?" -eq 0 ]; then
|
||||||
|
echo "Cannot read pid file ($pidfile)"
|
||||||
|
echo "$NAME running with PID: $pid"
|
||||||
|
return 4
|
||||||
|
else
|
||||||
|
echo "$NAME is not running"
|
||||||
|
return 3
|
||||||
|
fi
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
pid=$(pidofproc "$pathname")
|
pid=$(pidofproc "$pathname")
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$?" -ne 0 ]; then
|
if [ "$?" -eq 0 ]; then
|
||||||
echo "$NAME is not runing" && return 1
|
echo "$NAME running with PID: $pid"
|
||||||
else
|
return 0
|
||||||
echo "$NAME running with PID: $pid"
|
else
|
||||||
|
echo "$NAME is not runing"
|
||||||
|
return 3
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user