systemctl cat myunit.service
prints the contents of the main myunit.service
file followed by any override files. Is there a way to print the unit file that systemd will actually use, i.e. the one formed from merging the overrides into the main unit?
Sean's questions
I want to have some equipment connected to a UPS to shut down gracefully when mains is cut. This equipment does not have capability to read serial or USB, so software solutions are out. What I'm looking for is a hardware solution: a digital output which shows high or low depending on whether the UPS is on battery or mains.
I looked at some APC and other brand models, and all seem to use USB and/or RS-232 to communicate this information. I'm looking for something simple, just a single pin on the back that changes voltage when on battery, or perhaps two pins that get shorted together.
Does anyone know whether such features exist on available UPS models, or is it all software these days?
I've got a systemd service set up with the following configuration (in /etc/systemd/system/my-service.service
):
[Unit]
Description=My service
[Service]
WorkingDirectory=/path/to/my/service
User=some-user
Group=some-group
Restart=on-failure
RestartSec=20 5
ExecStart=my-service-binary
[Install]
WantedBy=multi-user.target
When the program is started, it provides a command line interface to allow interaction. However, as this program is run by systemd, I can't immediately see a way to interact with the program directly. Is there some way to "connect" to the stream the program provides, while running it as a service within systemd?