diff options
author | Duncan Overbruck <mail@duncano.de> | 2019-08-25 13:37:01 +0200 |
---|---|---|
committer | Duncan Overbruck <mail@duncano.de> | 2019-08-25 14:21:18 +0200 |
commit | 06c1ad4f8b54affde57d928c9557034969c36e21 (patch) | |
tree | f3c8f8a10d073f556ff6832dda83f729010c28aa | |
parent | b25043d6e1e75f29b438ae23a31950ab5401a0cd (diff) | |
download | runit-void-06c1ad4f8b54affde57d928c9557034969c36e21.tar.gz runit-void-06c1ad4f8b54affde57d928c9557034969c36e21.tar.xz runit-void-06c1ad4f8b54affde57d928c9557034969c36e21.zip |
vlogger: force to use syslog if message arguments are given
-rw-r--r-- | vlogger.8 | 40 | ||||
-rw-r--r-- | vlogger.c | 3 |
2 files changed, 32 insertions, 11 deletions
diff --git a/vlogger.8 b/vlogger.8 index 820cf3b..b7919d9 100644 --- a/vlogger.8 +++ b/vlogger.8 @@ -12,17 +12,35 @@ .Op Fl t Ar tag .Op Ar message ... .Sh DESCRIPTION -By default, +The .Nm -reads lines from +utility writes messages to the system log. +.Pp +With +.Ar message +arguments +.Nm +will always write messages to the system log. +Without +.Ar message +arguments +.Nm +reads messages from .Dv stdin -and sends them to syslog. -If the file +or the file specified with the +.Fl f +flag. +If the .Pa /etc/vlogger -exists and is executable it is executed with -.Ar tag -as only argument and replaces -.Nm . +executable exists +.Nm +executes it with +.Ar tag , +level +and priority as arguments, +replacing the +.Nm +process. .Pp If .Nm @@ -34,10 +52,10 @@ supervision suite it uses the service name as default As example if .Nm is linked to -.Dv /var/service/foo/log/run +.Pa /var/service/foo/log/run it uses -.Dv foo -as default +.Dq foo +as .Ar tag . .Pp The options are as follows: diff --git a/vlogger.c b/vlogger.c index c886239..64f1a2e 100644 --- a/vlogger.c +++ b/vlogger.c @@ -119,6 +119,9 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; + if (argc > 0) + Sflag++; + if (!Sflag && access("/etc/vlogger", X_OK) != -1) { CODE *cp; const char *sfacility = "", *slevel = ""; |