summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2016-11-19 19:55:42 +0100
committerThomas Deutschmann <whissi@gentoo.org>2016-11-19 19:56:04 +0100
commitd493c1ced55419c1b3a1b40e3a16d824c6d33f26 (patch)
tree6a8d214ec67b10b7bd447d89d07d18bd5da443c1 /sys-process
parentMerge remote-tracking branch 'github/pr/2627' (diff)
downloadgentoo-d493c1ced55419c1b3a1b40e3a16d824c6d33f26.tar.gz
gentoo-d493c1ced55419c1b3a1b40e3a16d824c6d33f26.tar.bz2
gentoo-d493c1ced55419c1b3a1b40e3a16d824c6d33f26.zip
sys-process/fcron: Bashism in runscript removed
With the previous bump 531e27c45e1 I have accidentally introduced bashisms into the runscript which are now removed. (Bug #600228) This revision also introduces a sanity check for multi instances to make sure that they don't use the default values so that they don't clash with the default instance. Gentoo-Bug: https://bugs.gentoo.org/600228 Package-Manager: portage-2.3.2
Diffstat (limited to 'sys-process')
-rw-r--r--sys-process/fcron/fcron-3.2.1-r1.ebuild (renamed from sys-process/fcron/fcron-3.2.1.ebuild)0
-rw-r--r--sys-process/fcron/files/fcron.init.436
2 files changed, 31 insertions, 5 deletions
diff --git a/sys-process/fcron/fcron-3.2.1.ebuild b/sys-process/fcron/fcron-3.2.1-r1.ebuild
index f3988dcb1adc..f3988dcb1adc 100644
--- a/sys-process/fcron/fcron-3.2.1.ebuild
+++ b/sys-process/fcron/fcron-3.2.1-r1.ebuild
diff --git a/sys-process/fcron/files/fcron.init.4 b/sys-process/fcron/files/fcron.init.4
index e2441ee13bca..25fafc16ec25 100644
--- a/sys-process/fcron/files/fcron.init.4
+++ b/sys-process/fcron/files/fcron.init.4
@@ -5,7 +5,7 @@
FCRON_INSTANCE="${SVCNAME##*.}"
-if [[ -n "${FCRON_INSTANCE}" && "${SVCNAME}" != "fcron" ]]; then
+if [ -n "${FCRON_INSTANCE}" -a "${SVCNAME}" != "fcron" ]; then
FCRON_CONFIGFILE="/etc/fcron/fcron.${FCRON_INSTANCE}.conf"
else
FCRON_CONFIGFILE="/etc/fcron/fcron.conf"
@@ -20,11 +20,11 @@ getconfig() {
value="$(service_get_value ${key})"
fi
- if [[ -z "${value}" && -r "${FCRON_CONFIGFILE}" ]]; then
+ if [ -z "${value}" -a -r "${FCRON_CONFIGFILE}" ]; then
value="$(sed -n -e 's:^'"${key}"'[ \t]*=[ \t]*::p' "${FCRON_CONFIGFILE}")"
fi
- if [[ -z "${value}" ]]; then
+ if [ -z "${value}" ]; then
# Value not explicitly set in the configfile or configfile does not exist
# or is not readable
echo "${value_default}"
@@ -42,7 +42,7 @@ depend() {
need hostname
# provide the cron service if we are the main instance
- [[ "${SVCNAME}" == "fcron" ]] && provide cron
+ [ "${SVCNAME}" = "fcron" ] && provide cron
}
command="/usr/libexec/fcron"
@@ -50,6 +50,7 @@ command_args="-c \"${FCRON_CONFIGFILE}\""
start_stop_daemon_args=${FCRON_SSDARGS:-"--wait 1000"}
pidfile="$(getconfig pidfile /run/fcron.pid)"
fcrontabs="$(getconfig fcrontabs /var/spool/fcron)"
+fifofile="$(getconfig fifofile /run/fcron.fifo)"
required_files="${FCRON_CONFIGFILE}"
extra_started_commands="reload"
@@ -59,9 +60,33 @@ reload() {
}
start_pre() {
+ if [ "${SVCNAME}" != "fcron" ]; then
+ local _has_invalid_instance_cfg=0
+
+ if [ "${pidfile}" = "/run/fcron.pid" ]; then
+ eerror "You cannot use the same pidfile like the default instance!"
+ eerror "Please adjust your 'pidfile' setting in '${FCRON_CONFIGFILE}'."
+ _has_invalid_instance_cfg=1
+ fi
+
+ if [ "${fcrontabs}" = "/var/spool/fcron" ]; then
+ eerror "You cannot use the same fcrontabs location like the default instance!"
+ eerror "Please adjust your 'fcrontabs' setting in '${FCRON_CONFIGFILE}'."
+ _has_invalid_instance_cfg=1
+ fi
+
+ if [ "${fifofile}" = "/run/fcron.fifo" ]; then
+ eerror "You cannot use the same fifo file like the default instance!"
+ eerror "Please adjust your 'fifofile' setting in '${FCRON_CONFIGFILE}'."
+ _has_invalid_instance_cfg=1
+ fi
+
+ [ ${_has_invalid_instance_cfg} -ne 0 ] && return 1
+ fi
+
checkpath --file "${FCRON_CONFIGFILE}" --owner root:fcron --mode 0640
- if [[ ! -d "${fcrontabs}" ]]; then
+ if [ ! -d "${fcrontabs}" ]; then
ebegin "Creating missing spooldir '${fcrontabs}'"
${command} --newspooldir "${fcrontabs}"
eend $?
@@ -70,4 +95,5 @@ start_pre() {
start_post() {
service_set_value fcrontabs "${fcrontabs}"
+ service_set_value fifofile "${fifofile}"
}