Commit Graph

8 Commits

Author SHA1 Message Date
Dimitri John Ledkov
35312d0c47 cpacfstatsd.service: only run on LPARs.
Add ConditionVirtualization=no to the service file such that it is
only started on LPARs. This service cannot run on z/VM nor KVM, and
fails resulting in a degraded boot.

Closes: https://github.com/ibm-s390-tools/s390-tools/pull/38
Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com>
Acked-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2018-10-19 15:31:40 +02:00
Gerald Schaefer
780133f825 mon_tools: Improve systemctl start error handling
This fixes the same issue as in commit 82c8148983 ("cpuplugd: Improve
systemctl start error handling") for mon_tools (mon_procd and mon_fsstatd).

Currently "systemctl start mon_procd/fsstatd" does not report any errors
in case the startup fails.

Example (with mon_procd):

 (change interval in /etc/sysconfig/mon_procd to an invalid value "abc")
 # systemctl start mon_procd

The reason is that for type=simple systemd forks/execs mon_procd and if
that is successful immediately returns. There is no way to find out if the
initial startup fails.

Fix this by using type=fork and running the process in the background. In
this case systemd waits until the initial process returns.

In addition use PIDFile and ensure that the pid file is already available
when the initial process returns. To achieve this, use startup
synchronization via pipe. Without that systemd would print the following
warning:

systemd[1]: mon_procd.service: PID file /var/run/mon_procd.pid not readable
            (yet?) after start: No such file or directory

With this patch, an early startup error like in the example above, is now
reported correctly in "systemctl start":

 # systemctl start mon_procd
   Job for mon_procd.service failed because the control process exited...
   See "systemctl status mon_procd.service" and "journalctl -xe" for ...
 # journalctl -xe | grep mon_procd
   mon_procd[3184]: Error: Invalid interval (needs to be greater than 0)

Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
2017-11-20 20:33:17 +01:00
Michael Holzheu
82c8148983 cpuplugd: Improve systemctl start error handling
Currently "systemctl start cpuplugd" does not report any errors in
case the startup fails.

Example:

 # mv /etc/cpuplugd.conf /etc/cpuplugd.conf.xxx
 # systemctl start cpuplugd

The reason is that for type=simple systemd forks/execs cpuplugd and if
that is successful immediately returns. There is no way to find out
if the initial startup fails.

Fix this by using type=fork and running cpuplugd in the background. In
this case systemd waits until the initial process returns.

In addition use PIDFile and ensure that the pid file is already available
when the initial cpuplugd process returns. To achieve this, replace the
daemon() function by our own implementation that introduces startup
synchronization via pipe. Without that systemd would print the following
warning:

systemd[1]: cpuplugd.service: PID file /var/run/cpuplugd.pid not readable
                              (yet?) after start: No such file or directory

With this patch, an early startup error like in the example above, is now
reported correctly in "systemctl start":

 # systemctl start cpuplugd
   Job for cpuplugd.service failed because the control process exited...
   See "systemctl status cpuplugd.service" and "journalctl -xe" for ...
 # journalctl -ex | grep cpuplugd
   Nov 16 15:52:27 ... cpuplugd[5096]: Opening configuration file failed:
                                       No such file or directory

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Acked-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
2017-11-20 20:29:20 +01:00
Michael Holzheu
f595bce3c0 systemd: Use SYSCONFDIR instead of /etc for 'make install'
Suggested-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Reviewed-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
2017-11-20 14:57:58 +01:00
Hendrik Brueckner
f0116ee79c cpi: add missing Install section to service unit
The cpi service unit requires an Install section to tell systemd
when to start the cpi service.  Add an install section and start
cpi for the multi-user target.

Reported-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Stefan Haberland <sth@linux.vnet.ibm.com>
2017-11-07 16:37:38 +01:00
Claudio Imbrenda
ca50924acb cpi: Introduce new udev rule and integrate with systemd unit
Add a new udev rule that is triggered when a KVM VM is started
on the system the very first time. This rule reports over the
sysfs CPI kernel interface that the system is a KVM host.

Currently the cpi.service systemd unit already works with
the CPI sysfs interface. Introduce a new internal utility
script "cpictl" that is used by both the udev rule and
the systemd unit to guarantee coordinated access to the
kernel CPU interface.

Signed-off-by: Claudio Imbrenda <imbrenda@linux.vnet.ibm.com>
Reviewed-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
Reviewed-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Reviewed-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
2017-09-15 05:03:04 +02:00
Philipp Kern
39382ec5fd systemd: Fix deprecated BindTo usage in ttyrun-getty@.service.in
BindTo was renamed to BindsTo in systemd back in v187 from July 2012.

Fixes: #1

Signed-off-by: Philipp Kern <pkern@debian.org>
Acked-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
2017-08-23 10:41:55 +02:00
Michael Holzheu
b627b8d8e1 Initial s390-tools-2.0.0 import
This commit is based on the s390-tools-1.39.0 version.

Changes on top of s390-tools-1.39.0:

 - Add MIT license to all source files
 - Add LICENSE file
 - Transform REAMDE to README.md (markdown)
 - Add AUTHORS.md file
 - Add CONTRIBUTING.md file
 - Move changelog from README to CHANGELOG.md file

Reviewed-by: Stefan Haberland <sth@linux.vnet.ibm.com>
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
2017-08-21 10:55:40 +02:00