Commit 89b43b7e authored by Vitaly Lipatov's avatar Vitaly Lipatov

backported to p8 as 1.9.6-alt0.M80P.1 (with rpmbph script)

parents b3a714f1 c0ca141c
......@@ -402,7 +402,7 @@ pkg_filenames=$(strip_spaces "$pkg_files $pkg_names")
if [ -z "$epm_cmd" ] ; then
print_version
echo
fatal "Run $ $PROGNAME --help for get help"
fatal "Unknown command $@. Run $ $PROGNAME --help for get help"
fi
# Use eatmydata for write specific operations
......
......@@ -271,7 +271,7 @@ set_sudo()
if which sudo >/dev/null 2>/dev/null ; then
SUDO="sudo --"
# 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
fi
......@@ -516,5 +516,5 @@ is_active_systemd()
[ -d "$SYSTEMD_CGROUP_DIR" ] || return
a= mountpoint -q "$SYSTEMD_CGROUP_DIR" || return
# some hack
ps ax | grep -q systemd >/dev/null
ps ax | grep -q '[s]ystemd' >/dev/null
}
......@@ -201,6 +201,9 @@ check_command()
serv_cmd=print
withoutservicename=1
;;
log|journal) # HELPCMD: print log for the service
serv_cmd=log
;;
*)
return 1
;;
......
......@@ -38,11 +38,6 @@ serv_list()
for i in $(serv_list_all) ; do
is_service_running $i >/dev/null && echo $i
done
# TODO: только запущенные
if [ -n "$ANYSERVICE" ] ; then
sudocmd $ANYSERVICE list
return
fi
;;
esac
}
......@@ -26,7 +26,7 @@ serv_list_all()
sudocmd chkconfig --list | cut -f1
if [ -n "$ANYSERVICE" ] ; then
sudocmd anyservice list
sudocmd anyservice --quiet list
return
fi
;;
......
#!/bin/sh
#
# Copyright (C) 2016 Etersoft
# Copyright (C) 2016 Vitaly Lipatov <lav@etersoft.ru>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
__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
}
# This spec is backported to ALTLinux p8 automatically by rpmbph script from etersoft-build-utils.
#
Name: eepm
Version: 1.9.4
Version: 1.9.6
Release: alt0.M80P.1
Summary: Etersoft EPM package manager
......@@ -68,9 +68,19 @@ chmod a+x %buildroot%_datadir/%name/tools_*
%_sysconfdir/bash_completion.d/cerv
%changelog
* Fri Sep 23 2016 Vitaly Lipatov <lav@altlinux.ru> 1.9.4-alt0.M80P.1
* Thu Oct 06 2016 Vitaly Lipatov <lav@altlinux.ru> 1.9.6-alt0.M80P.1
- backport to ALTLinux p8 (by rpmbph script)
* Sun Oct 02 2016 Vitaly Lipatov <lav@altlinux.ru> 1.9.6-alt1
- epm: improve message about incorrect command
- workaround for sudo -h prints first line in stderr
- example support for service SERVICE log command
* Fri Sep 23 2016 Vitaly Lipatov <lav@altlinux.ru> 1.9.5-alt1
- fix systemd detection
- initial log command support
- fix anyservice list (need anyservice 0.5 or above)
* Fri Sep 23 2016 Vitaly Lipatov <lav@altlinux.ru> 1.9.4-alt1
- distr_info: fix checking on MacOS
- brew fixes
......
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