Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eepm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
eepm
Commits
000bb297
Commit
000bb297
authored
Feb 18, 2020
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
serv log: run without follow (-f) by default
parent
ce10c02a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
9 deletions
+12
-9
serv
bin/serv
+1
-1
serv-log
bin/serv-log
+11
-8
No files found.
bin/serv
View file @
000bb297
...
...
@@ -207,7 +207,7 @@ check_command()
serv_cmd
=
print
withoutservicename
=
1
;;
log|journal
)
# HELPCMD: print log for the service
log|journal
)
# HELPCMD: print log for the service
(-f - follow, -r - reverse order)
serv_cmd
=
log
;;
edit
)
...
...
bin/serv-log
View file @
000bb297
#!/bin/sh
#
# Copyright (C) 2016 Etersoft
# Copyright (C) 2016 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2016
, 2020
Etersoft
# Copyright (C) 2016
, 2020
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
...
...
@@ -20,19 +20,21 @@
__serv_log_altlinux
()
{
local
SERVICE
=
"
$1
"
local
PRG
=
"less"
[
"
$2
"
=
"-f"
]
&&
PRG
=
"tail -f"
case
"
$SERVICE
"
in
postfix
)
sudocmd
tail
-f
/var/log/mail/all /var/log/mail/errors
sudocmd
$PRG
/var/log/mail/all /var/log/mail/errors
;;
sshd
)
sudocmd
tail
-f
/var/log/auth/all
sudocmd
$PRG
/var/log/auth/all
;;
cups
)
sudocmd
tail
-f
/var/log/cups/access_log /var/log/cups/error_log
sudocmd
$PRG
/var/log/cups/access_log /var/log/cups/error_log
;;
fail2ban
)
sudocmd
tail
-f
/var/log/
$SERVICE
.log
sudocmd
$PRG
/var/log/
$SERVICE
.log
;;
*
)
fatal
"Have no suitable for
$SERVICE
service"
...
...
@@ -47,12 +49,13 @@ serv_log()
case
$SERVICETYPE
in
systemd
)
sudocmd journalctl
-
f
-
b
-u
"
$SERVICE
"
"
$@
"
sudocmd journalctl
-b
-u
"
$SERVICE
"
"
$@
"
;;
*
)
case
$DISTRNAME
in
ALTLinux
)
__serv_log_altlinux
"
$SERVICE
"
FF
=
""
;
[
"
$1
"
=
"-f"
]
&&
FF
=
"-f"
__serv_log_altlinux
"
$SERVICE
"
$FF
return
;;
*
)
fatal
"Have no suitable for
$DISTRNAME
command for
$SERVICETYPE
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment