OpenMediaVault-Plugin-Developers / openmediavault-virtualbox

virtualbox plugin for OpenMediaVault
13 stars 6 forks source link

virtualbox-web sytemd unit spamming the syslog #10

Closed subzero79 closed 8 years ago

subzero79 commented 8 years ago

Everytime the phpvirtualbox url is open, the syslog get's spammed by the vboxwebdrv.

screen shot 2016-05-04 at 10 00 32 am

Either add to the unit

StandardOutput=null

or provide an exclusive logging file to the execstart

Oracle VM VirtualBox web service Version 5.0.18_Debian
(C) 2007-2016 Oracle Corporation
All rights reserved.

Usage: vboxwebsrv [options]

Supported options (default values in brackets):
--help, -h:            Print this help message and exit.
--background, -b:      Run in background (daemon mode).
--host, -H:            The host to bind to (localhost).
--port, -p:            The port to bind to (18083).
--ssl, -s:             Enable SSL/TLS encryption.
--keyfile, -K:         Server key and certificate file, PEM format ("").
--passwordfile, -a:    File name for password to server key ("").
--cacert, -c:          CA certificate file, PEM format ("").
--capath, -C:          CA certificate path ("").
--dhfile, -D:          DH file name or DH key length in bits ("").
--randfile, -r:        File containing seed for random number generator ("").
--timeout, -t:         Session timeout in seconds; 0 = disable timeouts (300).
--check-interval, -i:  Frequency of timeout checks in seconds (5).
--threads, -T:         Maximum number of worker threads to run in parallel (100).
--keepalive, -k:       Maximum number of requests before a socket will be closed (100).
--authentication, -A:  Authentication method for the webservice ("").
--verbose, -v:         Be verbose.
--pidfile, -P:         Name of the PID file which is created when the daemon was started.
--logfile, -F:         Name of file to write log to (no file).
--logrotate, -R:       Number of log files (0 disables log rotation).
--logsize, -S:         Maximum size of a log file to trigger rotation (bytes).
--loginterval, -I:     Maximum time interval to trigger log rotation (seconds).
ghost commented 8 years ago

I've left it that way intentionally for now because it's not really spam if the service prints it by default. I'll rule out the use of --logfile directly because journald is already taking care of the logging and the spam would still be there. Is there a more compelling reason to silence the daemon than it writing to syslog?

If we silence stdout I'd like to make sure that no necessary information is silenced for troubleshooting. If you could check that it would be nice.

subzero79 commented 8 years ago

Use a rsyslog configuration to a separate file. journalctl will still get flooded you can see that with status

Timestamps are 0.002 seconds, makes impossible to read the log.

:programname, contains, "vboxwebsrv" -/var/log/vboxwebdrv/vboxwebdrv.log
& stop
:msg, contains, "vboxwebsrv" stop

vboxwebsrv only includes an option just to make it more verbose, not turn down the level. Unless there is an undocumented option.

Also a logrotate will be necessary, if you leave the browser window open the log just goes to ~500KB in 4 minutes. We already know what happens when logs get fat leaving no rootfs free space.

ghost commented 8 years ago

But then it's just easier to use --logfile and --logrotate. There's no difference.

Is the size really that much of an issue? It would generate approximately 7.5 MB per hour by your numbers. How long phpVirtualBox sessions do you have?

As I said before, could you check and try to make it fail to see what happens when we silence stdout. Not all services write to stderr, but most likely it will.

subzero79 commented 8 years ago

Well you dismissed --logfile in the first place, not having too much options here.

I have no idea how to make the service fail, tried deleting the socket but the log did not spit errors. Tried signal 9 and fail status is reported by journal but not the log file.

Is not a problem for me the size, but think of other users with an OS partition of 2GB which is perfectly normal.

The main problem is unnecessary log messages in syslog, don't recall this in stoneburner with the plugin.