Summary: | Обновить functions-compat до современного состояния functions в Fedora | ||
---|---|---|---|
Product: | Sisyphus | Reporter: | Danil Mikhaylov <danil> |
Component: | service | Assignee: | placeholder <placeholder> |
Status: | CLOSED FIXED | QA Contact: | qa-sisyphus |
Severity: | normal | ||
Priority: | P3 | CC: | aen, cas, glebfm, imz, lav, ldv, legion, mike, placeholder, snejok |
Version: | unstable | ||
Hardware: | all | ||
OS: | Linux | ||
Bug Depends on: | |||
Bug Blocks: | 33431 |
Description
Danil Mikhaylov
2016-04-07 20:35:04 MSK
Совместимость по init-скриптам и пакетам с Fedora/RHEL — хорошая и достижимая цель. *** Bug 33431 has been marked as a duplicate of this bug. *** (In reply to comment #0) > Возможно стоит обновить functions-compat до > https://git.fedorahosted.org/cgit/initscripts.git/tree/rc.d/init.d/functions fedorahosted is retired. According to http://pkgs.fedoraproject.org/cgit/rpms/initscripts.git/tree/initscripts.spec , the new URL is: https://github.com/fedora-sysv/initscripts This file is at: https://github.com/fedora-sysv/initscripts/blob/master/rc.d/init.d/functions Тоже столкнулся с несовместимостью init functions при установке и запуске Grafana ping! Я пока подготовил серию патчей, берущих текущие functions из Fedora (тег 9.72) и превращающие их в functions-compat для ALT. Всё смотрел историю в ALT, пытался сколь-нибудь существенные изменения для ALT учесть. (Но цель: поменьше патчить, чтобы проще и понятнее rebase-ить на новые версии из Fedora.) Недоделки: где я возвращаю initlog, там на самом деле initlog не умеет выполнять shell-команды, поэтому собираюсь переписать так, чтобы передавать команду в переменной окружения и вызывать что-нибудь такое: /bin/sh -c $daemon_cmd_for_service. А также внести в эту команду limited из ALT. В спеке можно будет, имея оригинальную копию из Fedora, накладывать серию патчей. (Подшивать историю git, думаю, будет несколько громоздко, неудобно. А для работы последующей можно локально у себя делать git commit-ы.) Ветка 9.72-ALT-funcs-compat в git.altlinux.org/people/imz/packages/service.git commit c8d696ed8a5dff273cf54db811fcb4a74bb3a926 Author: Dmitry V. Levin <ldv@altlinux.org> Date: Wed Jan 21 12:54:08 2004 +0000 hide pidof (cherry picked from commit 53a0c0ed901e307607a0fcfc28aa6fd248873040) diff --git a/service/rc.d/init.d/functions-compat b/service/rc.d/init.d/functions-compat index e8c2d07..6f6e134 100644 --- a/service/rc.d/init.d/functions-compat +++ b/service/rc.d/init.d/functions-compat @@ -130,8 +130,11 @@ __pids_var_run() { # Output PIDs of matching processes, found using pidof __pids_pidof() { - pidof -c -m -o $$ -o $PPID -o %PPID -x "$1" || \ - pidof -c -m -o $$ -o $PPID -o %PPID -x "${1##*/}" + local PIDOF=/bin/pidof + [ -x "$PIDOF" ] && { + "$PIDOF" -c -m -o $$ -o $PPID -o %PPID -x "$1" || + "$PIDOF" -c -m -o $$ -o $PPID -o %PPID -x "${1##*/}" + } } commit ab6bf17663b0eb1af5c11f8ef7c58dd71495e1fd Author: Dmitry V. Levin <ldv@altlinux.org> Date: Mon May 12 10:48:00 2003 +0000 functions-compat: use msg_usage everywhere diff --git a/service/rc.d/init.d/functions-compat b/service/rc.d/init.d/functions-compat index e7cd4ac..e8c2d07 100644 --- a/service/rc.d/init.d/functions-compat +++ b/service/rc.d/init.d/functions-compat @@ -178,7 +178,7 @@ daemon() { shift ;; *) - echo $"$0: Usage: daemon [+/-nicelevel] {program}" "[arg1]..." + msg_usage "daemon [+/-nicelevel] [options]... {program} [arg1]..." return 1 ;; esac @@ -231,7 +231,7 @@ killproc() { RC=0; delay=3; try=0 # Test syntax. if [ "$#" -eq 0 ]; then - echo $"Usage: killproc [-p pidfile] [ -d delay] {program} [-signal]" + msg_usage "killproc [-p pidfile] [ -d delay] {program} [-signal]" return 1 fi if [ "$1" = "-p" ]; then @@ -240,8 +240,8 @@ killproc() { fi if [ "$1" = "-b" ]; then if [ -z $pid_file ]; then - echo $"-b option can be used only with -p" - echo $"Usage: killproc -p pidfile -b binary program" + echo $"-b option can be used only with -p" >&2 + msg_usage "killproc -p pidfile -b binary program" return 1 fi binary=$2 @@ -250,7 +250,7 @@ killproc() { if [ "$1" = "-d" ]; then delay=$(echo $2 | awk -v RS=' ' -v IGNORECASE=1 '{if($1!~/^[0-9.]+[smhd]?$/) exit 1;d=$1~/s$|^[0-9.]*$/?1:$1~/m$/?60:$1~/h$/?60*60:$1~/d$/?24*60*60:-1;if(d==-1) exit 1;delay+=d*$1} END {printf("%d",delay+0.5)}') if [ "$?" -eq 1 ]; then - echo $"Usage: killproc [-p pidfile] [ -d delay] {program} [-signal]" + msg_usage "killproc [-p pidfile] [ -d delay] {program} [-signal]" return 1 fi shift 2 @@ -313,7 +313,7 @@ pidfileofproc() { # Test syntax. if [ "$#" != 1 ] ; then - echo $"Usage: pidfileofproc {program}" + msg_usage "pidfileofproc {program}" return 1 fi @@ -328,7 +328,7 @@ pidofproc() { # Test syntax. if [ "$#" = 0 ]; then - echo $"Usage: pidofproc [-p pidfile] {program}" + msg_usage "pidofproc [-p pidfile] {program}" return 1 fi if [ "$1" = "-p" ]; then commit 45bb7e5ff65681485672b716473a31ad356c8655 Author: Ivan Zakharyaschev <imz@altlinux.org> Date: Fri Jul 7 16:47:23 2017 +0300 restored (but TODO: also use ALT's limited): initlog $INITLOG_ARGS -n "$base" initlog was deprecated and dropped in RH/Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=223446 -- Boot time messages from init scripts not being logged to /var/log/boot.log https://access.redhat.com/solutions/9834 -- How to enable boot-time logging (/var/log/boot.log) in Red Hat Enterprise Linux 5? diff --git a/service/rc.d/init.d/functions-compat b/service/rc.d/init.d/functions-compat index 11da9ff..e7cd4ac 100644 --- a/service/rc.d/init.d/functions-compat +++ b/service/rc.d/init.d/functions-compat @@ -216,9 +216,9 @@ daemon() { # And start it up. if [ -z "$user" ]; then - $cgroup $nice /bin/bash -c "$corelimit >/dev/null 2>&1 ; $*" + $cgroup $nice initlog $INITLOG_ARGS -n "$base" -c "$corelimit >/dev/null 2>&1 ; $*" else - $cgroup $nice runuser -s /bin/bash $user -c "$corelimit >/dev/null 2>&1 ; $*" + $cgroup $nice initlog $INITLOG_ARGS -n "$base" -c "su -s /bin/bash - $user -c \"$corelimit >/dev/null 2>&1 ; $*\"" fi [ "$?" -eq 0 ] && success $"$base startup" || failure $"$base startup" commit 28a9a40578033c6288966fb8c81ba798607aa11c Author: Ivan Zakharyaschev <imz@altlinux.org> Date: Fri Jul 7 16:13:59 2017 +0300 more reliable syntax: kill KILLLEVEL -- pids diff --git a/service/rc.d/init.d/functions-compat b/service/rc.d/init.d/functions-compat index f69d1c7..11da9ff 100644 --- a/service/rc.d/init.d/functions-compat +++ b/service/rc.d/init.d/functions-compat @@ -67,7 +67,7 @@ __kill_pids_term_kill() { [ -z "$kill_list" ] && return 0 - kill -TERM $kill_list >/dev/null 2>&1 + kill -TERM -- $kill_list >/dev/null 2>&1 sleep 0.1 kill_list=$(__kill_pids_term_kill_checkpids $base_stime $kill_list) @@ -79,7 +79,7 @@ __kill_pids_term_kill() { let try+=1 done if [ -n "$kill_list" ] ; then - kill -KILL $kill_list >/dev/null 2>&1 + kill -KILL -- $kill_list >/dev/null 2>&1 sleep 0.1 kill_list=$(__kill_pids_term_kill_checkpids $base_stime $kill_list) fi @@ -284,7 +284,7 @@ killproc() { # use specified level only else if checkpid $pid; then - kill $killlevel $pid >/dev/null 2>&1 + kill $killlevel -- $pid >/dev/null 2>&1 RC=$? [ "$RC" -eq 0 ] && success $"$base $killlevel" || failure $"$base $killlevel" elif [ -n "${LSB:-}" ]; then commit d6949da6a0777a07457944e824a0018e8652b713 Author: Ivan Zakharyaschev <imz@altlinux.org> Date: Fri Jul 7 16:09:03 2017 +0300 pidfileofproc(), pidofproc(): more restrictive syntax testing diff --git a/service/rc.d/init.d/functions-compat b/service/rc.d/init.d/functions-compat index e3f1024..f69d1c7 100644 --- a/service/rc.d/init.d/functions-compat +++ b/service/rc.d/init.d/functions-compat @@ -312,7 +312,7 @@ pidfileofproc() { local pid # Test syntax. - if [ "$#" = 0 ] ; then + if [ "$#" != 1 ] ; then echo $"Usage: pidfileofproc {program}" return 1 fi commit b41ef81dfe46a1bb63bb0c7e2b438ccd390c886a Author: Ivan Zakharyaschev <imz@altlinux.org> Date: Fri Jul 7 14:45:29 2017 +0300 unused var bg removed from daemon() (after the bg option was removed) diff --git a/service/rc.d/init.d/functions-compat b/service/rc.d/init.d/functions-compat index 80867d2..e3f1024 100644 --- a/service/rc.d/init.d/functions-compat +++ b/service/rc.d/init.d/functions-compat @@ -139,7 +139,7 @@ __pids_pidof() { daemon() { # Test syntax. local gotbase= force= corelimit - local pid base= user= nice= bg= pid_file= + local pid base= user= nice= pid_file= local cgroup= while [ "$1" != "${1##[-+]}" ]; do case $1 in commit deb5173d1bf4b4498fd53ac09546a92668ee7f9f Author: Ivan Zakharyaschev <imz@altlinux.org> Date: Fri Jul 7 14:43:28 2017 +0300 unreachable case removed from option parsing in daemon() diff --git a/service/rc.d/init.d/functions-compat b/service/rc.d/init.d/functions-compat index 4e71304..80867d2 100644 --- a/service/rc.d/init.d/functions-compat +++ b/service/rc.d/init.d/functions-compat @@ -143,10 +143,6 @@ daemon() { local cgroup= while [ "$1" != "${1##[-+]}" ]; do case $1 in - '') - echo $"$0: Usage: daemon [+/-nicelevel] {program}" "[arg1]..." - return 1 - ;; --check) base=$2 gotbase="yes" commit 0f7e77fd4f4c363c0f6146593b5be0b36ee38c2c Author: Ivan Zakharyaschev <imz@altlinux.org> Date: Fri Jul 7 14:42:41 2017 +0300 unused var nicelevel removed from daemon() diff --git a/service/rc.d/init.d/functions-compat b/service/rc.d/init.d/functions-compat index ae640ec..4e71304 100644 --- a/service/rc.d/init.d/functions-compat +++ b/service/rc.d/init.d/functions-compat @@ -138,10 +138,9 @@ __pids_pidof() { # A function to start a program. daemon() { # Test syntax. - local gotbase= force= nicelevel corelimit + local gotbase= force= corelimit local pid base= user= nice= bg= pid_file= local cgroup= - nicelevel=0 while [ "$1" != "${1##[-+]}" ]; do case $1 in '') commit 7727ce118f1aed7136a547054d022dbc54e28141 Author: Ivan Zakharyaschev <imz@altlinux.org> Date: Fri Jul 7 14:03:31 2017 +0300 removed things which are already in the main ALT's functions Compare with what we had in ALT (in older releases) with: git --no-pager diff -w HEAD:service/rc.d/init.d/functions-compat ac9db9953687b9589c26b6661c2d1e95b9b64759:rc.d/init.d/functions-compat diff --git a/service/rc.d/init.d/functions-compat b/service/rc.d/init.d/functions-compat index 0f627f1..ae640ec 100644 --- a/service/rc.d/init.d/functions-compat +++ b/service/rc.d/init.d/functions-compat @@ -1,104 +1,18 @@ +#!/bin/sh # -*-Shell-script-*- # -# functions This file contains functions to be used by most or all -# shell scripts in the /etc/init.d directory. +# Functions defined in this file are still used by many rc scripts; +# they offer some RedHat/Mandrake compatibility for 3rd party rc scripts. # - -TEXTDOMAIN=initscripts +# Version: 9.72 from https://github.com/fedora-sysv/initscripts +# adapted for use in ALT (by means of a few patches). +# +# Author: Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org> +# Hacked by: Greg Galloway and Marc Ewing # Make sure umask is sane umask 022 -# Set up a default search path. -PATH="/sbin:/usr/sbin:/bin:/usr/bin" -export PATH - -if [ $PPID -ne 1 -a -z "$SYSTEMCTL_SKIP_REDIRECT" ] && \ - [ -d /run/systemd/system ] ; then - case "$0" in - /etc/init.d/*|/etc/rc.d/init.d/*) - _use_systemctl=1 - ;; - esac -fi - -systemctl_redirect () { - local s - local prog=${1##*/} - local command=$2 - local options="" - - case "$command" in - start) - s=$"Starting $prog (via systemctl): " - ;; - stop) - s=$"Stopping $prog (via systemctl): " - ;; - reload|try-reload) - s=$"Reloading $prog configuration (via systemctl): " - ;; - restart|try-restart|condrestart) - s=$"Restarting $prog (via systemctl): " - ;; - esac - - if [ -n "$SYSTEMCTL_IGNORE_DEPENDENCIES" ] ; then - options="--ignore-dependencies" - fi - - if ! systemctl show "$prog.service" > /dev/null 2>&1 || \ - systemctl show -p LoadState "$prog.service" | grep -q 'not-found' ; then - action $"Reloading systemd: " /bin/systemctl daemon-reload - fi - - action "$s" /bin/systemctl $options $command "$prog.service" -} - -# Get a sane screen width -[ -z "${COLUMNS:-}" ] && COLUMNS=80 - -if [ -z "${CONSOLETYPE:-}" ]; then - if [ -c "/dev/stderr" -a -r "/dev/stderr" ]; then - CONSOLETYPE="$(/sbin/consoletype < /dev/stderr 2>/dev/null)" - else - CONSOLETYPE="serial" - fi -fi - -if [ -z "${NOLOCALE:-}" ] && [ -z "${LANGSH_SOURCED:-}" ] && \ - [ -f /etc/sysconfig/i18n -o -f /etc/locale.conf ] ; then - . /etc/profile.d/lang.sh 2>/dev/null - # avoid propagating LANGSH_SOURCED any further - unset LANGSH_SOURCED -fi - -# Read in our configuration -if [ -z "${BOOTUP:-}" ]; then - if [ -f /etc/sysconfig/init ]; then - . /etc/sysconfig/init - else - # This all seem confusing? Look in /etc/sysconfig/init, - # or in /usr/share/doc/initscripts-*/sysconfig.txt - BOOTUP=color - RES_COL=60 - MOVE_TO_COL="echo -en \\033[${RES_COL}G" - SETCOLOR_SUCCESS="echo -en \\033[1;32m" - SETCOLOR_FAILURE="echo -en \\033[1;31m" - SETCOLOR_WARNING="echo -en \\033[1;33m" - SETCOLOR_NORMAL="echo -en \\033[0;39m" - LOGLEVEL=1 - fi - if [ "$CONSOLETYPE" = "serial" ]; then - BOOTUP=serial - MOVE_TO_COL= - SETCOLOR_SUCCESS= - SETCOLOR_FAILURE= - SETCOLOR_WARNING= - SETCOLOR_NORMAL= - fi -fi - # Check if any of $pid (could be plural) are running checkpid() { local i @@ -439,253 +353,3 @@ pidofproc() { [ -n "$pid_file" ] && return $RC __pids_pidof "$1" || return $RC } - -status() { - local base pid lock_file= pid_file= binary= - - # Test syntax. - if [ "$#" = 0 ] ; then - echo $"Usage: status [-p pidfile] {program}" - return 1 - fi - if [ "$1" = "-p" ]; then - pid_file=$2 - shift 2 - fi - if [ "$1" = "-l" ]; then - lock_file=$2 - shift 2 - fi - if [ "$1" = "-b" ]; then - if [ -z $pid_file ]; then - echo $"-b option can be used only with -p" - echo $"Usage: status -p pidfile -b binary program" - return 1 - fi - binary=$2 - shift 2 - fi - base=${1##*/} - - if [ "$_use_systemctl" = "1" ]; then - systemctl status ${0##*/}.service - ret=$? - # LSB daemons that dies abnormally in systemd looks alive in systemd's eyes due to RemainAfterExit=yes - # lets adjust the reality a little bit - if systemctl show -p ActiveState ${0##*/}.service | grep -q '=active$' && \ - systemctl show -p SubState ${0##*/}.service | grep -q '=exited$' ; then - ret=3 - fi - return $ret - fi - - # First try "pidof" - __pids_var_run "$1" "$pid_file" "$binary" - RC=$? - if [ -z "$pid_file" -a -z "$pid" ]; then - pid="$(__pids_pidof "$1")" - fi - if [ -n "$pid" ]; then - echo $"${base} (pid $pid) is running..." - return 0 - fi - - case "$RC" in - 0) - echo $"${base} (pid $pid) is running..." - return 0 - ;; - 1) - echo $"${base} dead but pid file exists" - return 1 - ;; - 4) - echo $"${base} status unknown due to insufficient privileges." - return 4 - ;; - esac - if [ -z "${lock_file}" ]; then - lock_file=${base} - fi - # See if /var/lock/subsys/${lock_file} exists - if [ -f /var/lock/subsys/${lock_file} ]; then - echo $"${base} dead but subsys locked" - return 2 - fi - echo $"${base} is stopped" - return 3 -} - -echo_success() { - [ "$BOOTUP" = "color" ] && $MOVE_TO_COL - echo -n "[" - [ "$BOOTUP" = "color" ] && $SETCOLOR_SUCCESS - echo -n $" OK " - [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL - echo -n "]" - echo -ne "\r" - return 0 -} - -echo_failure() { - [ "$BOOTUP" = "color" ] && $MOVE_TO_COL - echo -n "[" - [ "$BOOTUP" = "color" ] && $SETCOLOR_FAILURE - echo -n $"FAILED" - [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL - echo -n "]" - echo -ne "\r" - return 1 -} - -echo_passed() { - [ "$BOOTUP" = "color" ] && $MOVE_TO_COL - echo -n "[" - [ "$BOOTUP" = "color" ] && $SETCOLOR_WARNING - echo -n $"PASSED" - [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL - echo -n "]" - echo -ne "\r" - return 1 -} - -echo_warning() { - [ "$BOOTUP" = "color" ] && $MOVE_TO_COL - echo -n "[" - [ "$BOOTUP" = "color" ] && $SETCOLOR_WARNING - echo -n $"WARNING" - [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL - echo -n "]" - echo -ne "\r" - return 1 -} - -# Inform the graphical boot of our current state -update_boot_stage() { - if [ -x /bin/plymouth ]; then - /bin/plymouth --update="$1" - fi - return 0 -} - -# Log that something succeeded -success() { - [ "$BOOTUP" != "verbose" -a -z "${LSB:-}" ] && echo_success - return 0 -} - -# Log that something failed -failure() { - local rc=$? - [ "$BOOTUP" != "verbose" -a -z "${LSB:-}" ] && echo_failure - [ -x /bin/plymouth ] && /bin/plymouth --details - return $rc -} - -# Log that something passed, but may have had errors. Useful for fsck -passed() { - local rc=$? - [ "$BOOTUP" != "verbose" -a -z "${LSB:-}" ] && echo_passed - return $rc -} - -# Log a warning -warning() { - local rc=$? - [ "$BOOTUP" != "verbose" -a -z "${LSB:-}" ] && echo_warning - return $rc -} - -# Run some action. Log its output. -action() { - local STRING rc - - STRING=$1 - echo -n "$STRING " - shift - "$@" && success $"$STRING" || failure $"$STRING" - rc=$? - echo - return $rc -} - -# returns OK if $1 contains $2 -strstr() { - [ "${1#*$2*}" = "$1" ] && return 1 - return 0 -} - -# Check whether file $1 is a backup or rpm-generated file and should be ignored -is_ignored_file() { - case "$1" in - *~ | *.bak | *.old | *.orig | *.rpmnew | *.rpmorig | *.rpmsave) - return 0 - ;; - esac - return 1 -} - -# Evaluate shvar-style booleans -is_true() { - case "$1" in - [tT] | [yY] | [yY][eE][sS] | [tT][rR][uU][eE] | 1) - return 0 - ;; - esac - return 1 -} - -# Evaluate shvar-style booleans -is_false() { - case "$1" in - [fF] | [nN] | [nN][oO] | [fF][aA][lL][sS][eE] | 0) - return 0 - ;; - esac - return 1 -} - -# Apply sysctl settings, including files in /etc/sysctl.d -apply_sysctl() { - if [ -x /lib/systemd/systemd-sysctl ]; then - /lib/systemd/systemd-sysctl - else - for file in /usr/lib/sysctl.d/*.conf ; do - is_ignored_file "$file" && continue - [ -f /run/sysctl.d/${file##*/} ] && continue - [ -f /etc/sysctl.d/${file##*/} ] && continue - test -f "$file" && sysctl -e -p "$file" >/dev/null 2>&1 - done - for file in /run/sysctl.d/*.conf ; do - is_ignored_file "$file" && continue - [ -f /etc/sysctl.d/${file##*/} ] && continue - test -f "$file" && sysctl -e -p "$file" >/dev/null 2>&1 - done - for file in /etc/sysctl.d/*.conf ; do - is_ignored_file "$file" && continue - test -f "$file" && sysctl -e -p "$file" >/dev/null 2>&1 - done - sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1 - fi -} - -# A sed expression to filter out the files that is_ignored_file recognizes -__sed_discard_ignored_files='/\(~\|\.bak\|\.old\|\.orig\|\.rpmnew\|\.rpmorig\|\.rpmsave\)$/d' - -if [ "$_use_systemctl" = "1" ]; then - if [ "x$1" = xstart -o \ - "x$1" = xstop -o \ - "x$1" = xrestart -o \ - "x$1" = xreload -o \ - "x$1" = xtry-restart -o \ - "x$1" = xforce-reload -o \ - "x$1" = xcondrestart ] ; then - - systemctl_redirect $0 $1 - exit $? - fi -fi - -strstr "$(cat /proc/cmdline)" "rc.debug" && set -x -return 0 - С совместимостью по функции status() есть такая неприятность (помимо наличия в Fedora коротких опций): в ALT проверка совпадения /proc/PID/exe с обязательным аргументом происходит по умолчанию, а в Fedora опционально (с тем, что указано опцией -b; и только если такая опция есть). Так что вызов status, который работал в Fedora, не обязательно будет работать в ALT. У меня есть вариант functions-compat с перекрытием функции status (лучше работает, но может по ошибке пролезть в наши скрипты) и без. В принципе, в дальнейшем, можно переименовать функцию status в ALT. Потребует простой замены в пакетах из списка: apt-cache whatdepends '/etc/rc.d/init.d(status)' (больше 400). И на всякий случай запретить Requires на старое имя, как уже сделано для некоторых функций из functions-compat (наверное, в sisyphus-check). (In reply to comment #6) > С совместимостью по функции status() есть такая неприятность (помимо наличия в > Fedora коротких опций): > > в ALT проверка совпадения /proc/PID/exe с обязательным аргументом происходит по > умолчанию, а в Fedora опционально (с тем, что указано опцией -b; и только если > такая опция есть). > > Так что вызов status, который работал в Fedora, не обязательно будет работать в > ALT. > > У меня есть вариант functions-compat с перекрытием функции status (лучше > работает, но может по ошибке пролезть в наши скрипты) и без. А почему бы нам вообще не оторвать /etc/init.d/functions-compat от /etc/init.d/functions и пакета service (и в обратную сторону тоже оторвать)? Назвать пакет initscripts-fedora-compat или как-нибудь ещё, у пусть там происходит что угодно. На всякий случай запретить зависимости на этот пакет в sisyphus_check. Мы же всё равно не рассчитываем, что пакеты для федоры будут у нас работать без изменений. > В принципе, в дальнейшем, можно переименовать функцию status в ALT. Потребует > простой замены в пакетах из списка: apt-cache whatdepends > '/etc/rc.d/init.d(status)' (больше 400). Вообще не вариант. (In reply to comment #7) > > У меня есть вариант functions-compat с перекрытием функции status (лучше > > работает, но может по ошибке пролезть в наши скрипты) и без. > > А почему бы нам вообще не оторвать /etc/init.d/functions-compat от > /etc/init.d/functions и пакета service (и в обратную сторону тоже оторвать)? > Назвать пакет initscripts-fedora-compat или как-нибудь ещё, у пусть там > происходит что угодно. Да, мне кажется, так даже проще будет. > На всякий случай запретить зависимости на этот пакет в sisyphus_check. > Мы же всё равно не рассчитываем, что пакеты для федоры будут у нас работать без > изменений. aptbox/apt-cache whatdepends '/etc/rc.d/init.d(checkpid)' '/etc/rc.d/init.d(daemon)' '/etc/rc.d/init.d(wait_pid)' '/etc/rc.d/init.d(killproc)' '/etc/rc.d/init.d(pidfileofproc)' '/etc/rc.d/init.d(pidofproc)' </etc/rc.d/init.d(checkpid)> xrdp-0.9.2-alt1 Depends: </etc/rc.d/init.d(checkpid)> service-0.5.26-alt1 jetty-9.4.0-alt1_0.2.M0jpp8 Depends: </etc/rc.d/init.d(checkpid)> service-0.5.26-alt1 checkpid сама по себе безвредная функция. Придётся либо исправить эти два пакета, либо перенести checkpid из compat. initscripts-compat-fedora-9.72-alt1 -> sisyphus: * Tue Jul 04 2017 Ivan Zakharyaschev <imz@altlinux> 9.72-alt1 - functions-compat: copied the central piece of code from Fedora (tag 9.72) and restored as in ALT: initlog, limited, hide pidof; ALT's status() overridden because the check of the PID's executable is default in ALT and optional in Fedora (with -b). (ALT#31952) * Thu May 25 2017 David Kaspar [Dee'Kej] <dkaspar@redhat.com> - 9.72-1 - rename_device.c: rewrite of isCfg() function - Add *.old to list of ignored files - Replace usleep(1) calls with sleep(1) calls * Wed May 24 2017 David Kaspar [Dee'Kej] <dkaspar@redhat.com> - 9.71-1 - usleep: print deprecation warning from now on - sysconfig.txt: mention previously introduced NO_DHCP_HOSTNAME option - DHCP_FQDN and DHCP_SEND_HOSTNAME introduced - re-add missing $HOSTNAME initialization - ifup: add support for VLAN_EGRESS_PRIORITY_MAP - specfile: mark 'rwtab' and 'statetab' as config files - killproc/status: add missing '-b <binary>' option - ifdown-eth: we need to flush global scope as well - ifup-eth: remove quote marks - po: download latest translations from zanata - rwtab: add /var/lib/systemd/timers - Update initscripts.pot - Port headers in xgettext_sh.py to 2017 |