Commit fbe06718 authored by Vitaly Lipatov's avatar Vitaly Lipatov

commit packed

parent c0ca141c
...@@ -275,7 +275,7 @@ set_sudo() ...@@ -275,7 +275,7 @@ set_sudo()
if which sudo >/dev/null 2>/dev/null ; then if which sudo >/dev/null 2>/dev/null ; then
SUDO="sudo --" SUDO="sudo --"
# check for < 1.7 version which do not support -- (and --help possible too) # check for < 1.7 version which do not support -- (and --help possible too)
sudo -h | grep -q " --" || SUDO="sudo" sudo -h 2>/dev/null | grep -q " --" || SUDO="sudo"
return return
fi fi
...@@ -508,7 +508,7 @@ is_active_systemd() ...@@ -508,7 +508,7 @@ is_active_systemd()
[ -d "$SYSTEMD_CGROUP_DIR" ] || return [ -d "$SYSTEMD_CGROUP_DIR" ] || return
a= mountpoint -q "$SYSTEMD_CGROUP_DIR" || return a= mountpoint -q "$SYSTEMD_CGROUP_DIR" || return
# some hack # some hack
pidof systemd >/dev/null ps ax | grep -q '[s]ystemd' >/dev/null
} }
# File bin/epm-addrepo: # File bin/epm-addrepo:
...@@ -3108,7 +3108,7 @@ __epm_query_name() ...@@ -3108,7 +3108,7 @@ __epm_query_name()
CMD="conary query" CMD="conary query"
;; ;;
homebrew) homebrew)
warning "fix query" docmd brew info "$1" >/dev/null 2>/dev/null && echo "$1" && return
return 1 return 1
;; ;;
# TODO: need to print name if exists # TODO: need to print name if exists
...@@ -4687,7 +4687,7 @@ __query_package_hl_url() ...@@ -4687,7 +4687,7 @@ __query_package_hl_url()
# http://petstore.swagger.io/?url=http://packages.altlinux.org/api/docs # http://petstore.swagger.io/?url=http://packages.altlinux.org/api/docs
epm assure curl || return 1 epm assure curl || return 1
showcmd curl "$PAOAPI/srpms/$1" showcmd curl "$PAOAPI/srpms/$1"
curl -s --header "Accept: application/json" "$PAOAPI/srpms/$1" | grep '"url"' | sed -e 's|.*"url":"||g' | sed -e 's|".*||g' a= curl -s --header "Accept: application/json" "$PAOAPI/srpms/$1" | grep '"url"' | sed -e 's|.*"url":"||g' | sed -e 's|".*||g'
return 0 return 0
;; ;;
esac esac
...@@ -5519,7 +5519,7 @@ $(get_help HELPOPT) ...@@ -5519,7 +5519,7 @@ $(get_help HELPOPT)
print_version() print_version()
{ {
echo "EPM package manager version 1.9.3" echo "EPM package manager version 1.9.6"
echo "Running on $($DISTRVENDOR) ('$PMTYPE' package manager uses '$PKGFORMAT' package format)" echo "Running on $($DISTRVENDOR) ('$PMTYPE' package manager uses '$PKGFORMAT' package format)"
echo "Copyright (c) Etersoft 2012-2016" echo "Copyright (c) Etersoft 2012-2016"
echo "This program may be freely redistributed under the terms of the GNU AGPLv3." echo "This program may be freely redistributed under the terms of the GNU AGPLv3."
...@@ -5858,7 +5858,7 @@ pkg_filenames=$(strip_spaces "$pkg_files $pkg_names") ...@@ -5858,7 +5858,7 @@ pkg_filenames=$(strip_spaces "$pkg_files $pkg_names")
if [ -z "$epm_cmd" ] ; then if [ -z "$epm_cmd" ] ; then
print_version print_version
echo echo
fatal "Run $ $PROGNAME --help for get help" fatal "Unknown command $@. Run $ $PROGNAME --help for get help"
fi fi
# Use eatmydata for write specific operations # Use eatmydata for write specific operations
......
...@@ -268,7 +268,7 @@ set_sudo() ...@@ -268,7 +268,7 @@ set_sudo()
if which sudo >/dev/null 2>/dev/null ; then if which sudo >/dev/null 2>/dev/null ; then
SUDO="sudo --" SUDO="sudo --"
# check for < 1.7 version which do not support -- (and --help possible too) # check for < 1.7 version which do not support -- (and --help possible too)
sudo -h | grep -q " --" || SUDO="sudo" sudo -h 2>/dev/null | grep -q " --" || SUDO="sudo"
return return
fi fi
...@@ -501,7 +501,7 @@ is_active_systemd() ...@@ -501,7 +501,7 @@ is_active_systemd()
[ -d "$SYSTEMD_CGROUP_DIR" ] || return [ -d "$SYSTEMD_CGROUP_DIR" ] || return
a= mountpoint -q "$SYSTEMD_CGROUP_DIR" || return a= mountpoint -q "$SYSTEMD_CGROUP_DIR" || return
# some hack # some hack
pidof systemd >/dev/null ps ax | grep -q '[s]ystemd' >/dev/null
} }
# File bin/serv-common: # File bin/serv-common:
...@@ -636,11 +636,6 @@ serv_list() ...@@ -636,11 +636,6 @@ serv_list()
for i in $(serv_list_all) ; do for i in $(serv_list_all) ; do
is_service_running $i >/dev/null && echo $i is_service_running $i >/dev/null && echo $i
done done
# TODO: только запущенные
if [ -n "$ANYSERVICE" ] ; then
sudocmd $ANYSERVICE list
return
fi
;; ;;
esac esac
} }
...@@ -655,7 +650,7 @@ serv_list_all() ...@@ -655,7 +650,7 @@ serv_list_all()
sudocmd chkconfig --list | cut -f1 sudocmd chkconfig --list | cut -f1
if [ -n "$ANYSERVICE" ] ; then if [ -n "$ANYSERVICE" ] ; then
sudocmd anyservice list sudocmd anyservice --quiet list
return return
fi fi
;; ;;
...@@ -685,6 +680,49 @@ serv_list_startup() ...@@ -685,6 +680,49 @@ serv_list_startup()
esac esac
} }
# File bin/serv-log:
__serv_log_altlinux()
{
local SERVICE="$1"
case "$SERVICE" in
postfix)
sudocmd tail -f /var/log/mail/all /var/log/mail/errors
;;
cups)
sudocmd tail -f /var/log/cups/access_log /var/log/cups/error_log
;;
fail2ban)
sudocmd tail -f /var/log/$SERVICE.log
;;
*)
fatal "Have no suitable for $SERVICE service"
;;
esac
}
serv_log()
{
local SERVICE="$1"
shift
case $SERVICETYPE in
systemd)
sudocmd journalctl -f -b -u "$SERVICE" "$@"
;;
*)
case $DISTRNAME in
ALTLinux)
__serv_log_altlinux "$SERVICE"
return ;;
*)
fatal "Have no suitable for $DISTRNAME command for $SERVICETYPE"
;;
esac
esac
}
# File bin/serv-print: # File bin/serv-print:
serv_print() serv_print()
...@@ -1498,8 +1536,8 @@ $(get_help HELPOPT) ...@@ -1498,8 +1536,8 @@ $(get_help HELPOPT)
print_version() print_version()
{ {
echo "Service manager version 1.9.3" echo "Service manager version 1.9.6"
echo "Running on $($DISTRVENDOR)" echo "Running on $($DISTRVENDOR) with $SERVICETYPE"
echo "Copyright (c) Etersoft 2012, 2013, 2016" echo "Copyright (c) Etersoft 2012, 2013, 2016"
echo "This program may be freely redistributed under the terms of the GNU AGPLv3." echo "This program may be freely redistributed under the terms of the GNU AGPLv3."
} }
...@@ -1570,6 +1608,9 @@ check_command() ...@@ -1570,6 +1608,9 @@ check_command()
serv_cmd=print serv_cmd=print
withoutservicename=1 withoutservicename=1
;; ;;
log|journal) # HELPCMD: print log for the service
serv_cmd=log
;;
*) *)
return 1 return 1
;; ;;
......
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