Commit 6ef16cfb authored by Vitaly Lipatov's avatar Vitaly Lipatov

commit packed 3.64.41

parent 06578eb5
...@@ -34,7 +34,7 @@ SHAREDIR="$PROGDIR" ...@@ -34,7 +34,7 @@ SHAREDIR="$PROGDIR"
# will replaced with /etc/eepm during install # will replaced with /etc/eepm during install
CONFIGDIR="$PROGDIR/../etc" CONFIGDIR="$PROGDIR/../etc"
export EPMVERSION="3.64.40" export EPMVERSION="3.64.41"
# package, single (file), pipe, git # package, single (file), pipe, git
EPMMODE="package" EPMMODE="package"
...@@ -18511,7 +18511,7 @@ get_urls() ...@@ -18511,7 +18511,7 @@ get_urls()
# cat html, divide to lines by tags and cut off hrefs only # cat html, divide to lines by tags and cut off hrefs only
scat "$URL" | sed -e 's|<|<\n|g' -e 's|data-file=|href=|g' -e "s|href=http|href=\"http|g" -e "s|>|\">|g" -e "s|'|\"|g" | \ scat "$URL" | sed -e 's|<|<\n|g' -e 's|data-file=|href=|g' -e "s|href=http|href=\"http|g" -e "s|>|\">|g" -e "s|'|\"|g" | \
grep -i -o -E 'href="(.+)"' | sed -e 's|&amp;|\&|' | cut -d'"' -f2 grep -i -o -E 'href="(.+)"' | sed -e 's|&amp;|\&|' | cut -d'"' -f2 | sed -e 's|^ *||g' -e 's| *$||g'
} }
......
...@@ -34,7 +34,7 @@ SHAREDIR=$PROGDIR ...@@ -34,7 +34,7 @@ SHAREDIR=$PROGDIR
# will replaced with /etc/eepm during install # will replaced with /etc/eepm during install
CONFIGDIR=$PROGDIR/../etc CONFIGDIR=$PROGDIR/../etc
EPMVERSION="3.64.40" EPMVERSION="3.64.41"
# package, single (file), pipe, git # package, single (file), pipe, git
EPMMODE="package" EPMMODE="package"
...@@ -1151,7 +1151,7 @@ serv_cat() ...@@ -1151,7 +1151,7 @@ serv_cat()
case $SERVICETYPE in case $SERVICETYPE in
systemd) systemd)
docmd systemctl cat "$SERVICE" "$@" run_systemctl cat "$SERVICE" "$@"
;; ;;
*) *)
case $BASEDISTRNAME in case $BASEDISTRNAME in
...@@ -1188,7 +1188,7 @@ serv_common() ...@@ -1188,7 +1188,7 @@ serv_common()
if [ -x $INITDIR/$SERVICE ] ; then if [ -x $INITDIR/$SERVICE ] ; then
sudocmd $INITDIR/$SERVICE "$@" sudocmd $INITDIR/$SERVICE "$@"
else else
sudocmd systemctl "$@" $SERVICE run_systemctl "$@" $SERVICE
fi fi
;; ;;
runit) runit)
...@@ -1221,7 +1221,7 @@ serv_disable() ...@@ -1221,7 +1221,7 @@ serv_disable()
sudocmd update-rc.d $1 remove sudocmd update-rc.d $1 remove
;; ;;
systemd) systemd)
sudocmd systemctl disable $1 run_systemctl disable $1
;; ;;
openrc) openrc)
sudocmd rc-update del $1 default sudocmd rc-update del $1 default
...@@ -1244,7 +1244,7 @@ serv_edit() ...@@ -1244,7 +1244,7 @@ serv_edit()
case $SERVICETYPE in case $SERVICETYPE in
systemd) systemd)
sudocmd systemctl edit "$@" "$SERVICE" run_systemctl edit "$@" "$SERVICE"
;; ;;
*) *)
fatal "Have no suitable for $DISTRNAME command for $SERVICETYPE" fatal "Have no suitable for $DISTRNAME command for $SERVICETYPE"
...@@ -1278,7 +1278,7 @@ serv_enable() ...@@ -1278,7 +1278,7 @@ serv_enable()
sudocmd update-rc.d $1 defaults sudocmd update-rc.d $1 defaults
;; ;;
systemd) systemd)
sudocmd systemctl enable $1 run_systemctl enable $1
;; ;;
openrc) openrc)
sudocmd rc-update add $1 default sudocmd rc-update add $1 default
...@@ -1304,7 +1304,7 @@ serv_exists() ...@@ -1304,7 +1304,7 @@ serv_exists()
case $SERVICETYPE in case $SERVICETYPE in
systemd) systemd)
# too direct way: test -s /lib/systemd/system/dm.service # too direct way: test -s /lib/systemd/system/dm.service
docmd systemctl cat "$SERVICE" "$@" >/dev/null 2>/dev/null run_systemctl cat "$SERVICE" "$@" >/dev/null 2>/dev/null
;; ;;
*) *)
case $BASEDISTRNAME in case $BASEDISTRNAME in
...@@ -1333,9 +1333,9 @@ serv_list() ...@@ -1333,9 +1333,9 @@ serv_list()
;; ;;
systemd) systemd)
if [ -n "$short" ] ; then if [ -n "$short" ] ; then
docmd systemctl list-units --type=service "$@" | grep '\.service' | sed -e 's|\.service.*||' -e 's|^ *||' run_systemctl list-units --type=service "$@" | grep '\.service' | sed -e 's|\.service.*||' -e 's|^ *||'
else else
docmd systemctl list-units --type=service "$@" run_systemctl list-units --type=service "$@"
fi fi
;; ;;
openrc) openrc)
...@@ -1382,9 +1382,9 @@ serv_list_all() ...@@ -1382,9 +1382,9 @@ serv_list_all()
;; ;;
systemd) systemd)
if [ -n "$short" ] ; then if [ -n "$short" ] ; then
docmd systemctl list-unit-files --type=service "$@" | sed -e 's|\.service.*||' | grep -v 'unit files listed' | grep -v '^$' run_systemctl list-unit-files --type=service "$@" | sed -e 's|\.service.*||' | grep -v 'unit files listed' | grep -v '^$'
else else
docmd systemctl list-unit-files --type=service "$@" run_systemctl list-unit-files --type=service "$@"
fi fi
;; ;;
openrc) openrc)
...@@ -1406,7 +1406,7 @@ serv_list_failed() ...@@ -1406,7 +1406,7 @@ serv_list_failed()
{ {
case $SERVICETYPE in case $SERVICETYPE in
systemd) systemd)
sudocmd systemctl --failed run_systemctl --failed
;; ;;
*) *)
for i in $(short=1 serv_list_startup) ; do for i in $(short=1 serv_list_startup) ; do
...@@ -1538,7 +1538,7 @@ serv_reload() ...@@ -1538,7 +1538,7 @@ serv_reload()
sudocmd $INITDIR/$SERVICE reload "$@" sudocmd $INITDIR/$SERVICE reload "$@"
;; ;;
systemd) systemd)
sudocmd systemctl reload $SERVICE "$@" run_systemctl reload $SERVICE "$@"
;; ;;
*) *)
info "Fallback to restart..." info "Fallback to restart..."
...@@ -1567,7 +1567,7 @@ serv_restart() ...@@ -1567,7 +1567,7 @@ serv_restart()
sudocmd $INITDIR/$SERVICE restart "$@" sudocmd $INITDIR/$SERVICE restart "$@"
;; ;;
systemd) systemd)
sudocmd systemctl restart $SERVICE "$@" run_systemctl restart $SERVICE "$@"
;; ;;
runit) runit)
sudocmd sv restart "$SERVICE" sudocmd sv restart "$SERVICE"
...@@ -1600,7 +1600,7 @@ serv_start() ...@@ -1600,7 +1600,7 @@ serv_start()
sudocmd $INITDIR/$SERVICE start "$@" sudocmd $INITDIR/$SERVICE start "$@"
;; ;;
systemd) systemd)
sudocmd systemctl start "$SERVICE" "$@" run_systemctl start "$SERVICE" "$@"
;; ;;
runit) runit)
sudocmd sv up "$SERVICE" sudocmd sv up "$SERVICE"
...@@ -1695,7 +1695,7 @@ serv_status() ...@@ -1695,7 +1695,7 @@ serv_status()
sudocmd $INITDIR/$SERVICE status "$@" sudocmd $INITDIR/$SERVICE status "$@"
;; ;;
systemd) systemd)
docmd systemctl -l status $SERVICE "$@" run_systemctl -l status $SERVICE "$@"
;; ;;
runit) runit)
sudocmd sv status "$SERVICE" sudocmd sv status "$SERVICE"
...@@ -1725,7 +1725,7 @@ serv_stop() ...@@ -1725,7 +1725,7 @@ serv_stop()
sudocmd $INITDIR/$SERVICE stop "$@" sudocmd $INITDIR/$SERVICE stop "$@"
;; ;;
systemd) systemd)
sudocmd systemctl stop $SERVICE "$@" run_systemctl stop $SERVICE "$@"
;; ;;
runit) runit)
sudocmd sv down "$SERVICE" sudocmd sv down "$SERVICE"
...@@ -1782,7 +1782,7 @@ serv_try_restart() ...@@ -1782,7 +1782,7 @@ serv_try_restart()
case $SERVICETYPE in case $SERVICETYPE in
systemd) systemd)
sudocmd systemctl try-restart $SERVICE "$@" run_systemctl try-restart $SERVICE "$@"
;; ;;
*) *)
info "Fallback to restart..." info "Fallback to restart..."
...@@ -1814,7 +1814,7 @@ serv_usage() ...@@ -1814,7 +1814,7 @@ serv_usage()
sudorun service $SERVICE 2>&1 sudorun service $SERVICE 2>&1
;; ;;
systemd) systemd)
sudocmd systemctl $SERVICE 2>&1 run_systemctl "$SERVICE" 2>&1
;; ;;
*) *)
fatal "Have no suitable command for $SERVICETYPE in serv_usage()" fatal "Have no suitable command for $SERVICETYPE in serv_usage()"
...@@ -3187,6 +3187,10 @@ serv_cmd= ...@@ -3187,6 +3187,10 @@ serv_cmd=
service_name= service_name=
params= params=
withoutservicename= withoutservicename=
systemctl_scope=
SYSTEMCTL="systemctl"
SYSTEMCTL_ARGS=
SYSTEMCTL_RUNNER=sudocmd
# load system wide config # load system wide config
[ -f /etc/eepm/serv.conf ] && . /etc/eepm/serv.conf [ -f /etc/eepm/serv.conf ] && . /etc/eepm/serv.conf
...@@ -3299,6 +3303,9 @@ check_option() ...@@ -3299,6 +3303,9 @@ check_option()
--auto) # HELPOPT: non interactive mode --auto) # HELPOPT: non interactive mode
non_interactive=1 non_interactive=1
;; ;;
--user) # HELPOPT: manage user services via systemctl --user
systemctl_scope=user
;;
*) *)
return 1 return 1
;; ;;
...@@ -3306,6 +3313,12 @@ check_option() ...@@ -3306,6 +3313,12 @@ check_option()
return 0 return 0
} }
run_systemctl()
{
$SYSTEMCTL_RUNNER $SYSTEMCTL $SYSTEMCTL_ARGS "$@"
}
for opt in "$@" ; do for opt in "$@" ; do
check_command $opt && continue check_command $opt && continue
check_option $opt && continue check_option $opt && continue
...@@ -3313,6 +3326,16 @@ for opt in "$@" ; do ...@@ -3313,6 +3326,16 @@ for opt in "$@" ; do
params="$params $opt" params="$params $opt"
done done
if [ "$systemctl_scope" = "user" ]; then
if [ "$SERVICETYPE" != "systemd" ]; then
fatal "--user option is supported only with systemd backend"
fi
SYSTEMCTL_ARGS="--user"
SYSTEMCTL_RUNNER=docmd
fi
echover "service: $service_name" echover "service: $service_name"
echover "command: $serv_cmd" echover "command: $serv_cmd"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment