[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Debugging a LSB init script under systemd



 Hi.

On Thu, 09 Jul 2015 14:37:52 +1000
Stuart Longland <stuartl@longlandclan.yi.org> wrote:

> Hi all,
> 
> Is there any way to debug a LSB init script under systemd?  I'm trying
> to write an init script for a service that starts multiple daemons, much
> like OpenVPN and how it starts a separate daemon for each connection.
> 
> So I've taken the OpenVPN init script and hacked it to make it do what I
> want.  One problem I had though was getting any useful debugging output.
> 
> The OpenVPN init script takes a parameter DEBIAN_SCRIPT_DEBUG.  I've
> tried setting that in my environment and exporting it, to no avail.
> I've also tried running the init script directly with `sh -ex`, again,
> no dice.  systemd immediately swallows the DEBIAN_SCRIPT_DEBUG as well
> as any useful output from the init script itself.
> 
> The suggested `journalctl -xn` provides minimal assistance.  I also seem
> to lose the ability to see the script's status report when I run
> `/etc/init.d/foo status`: I get systemd's view of the situation instead.
> 
> Is there a way to tell systemd to LEAVE the script alone while I debug
> it and get it working?

Yes. Setting _SYSTEMCTL_SKIP_REDIRECT environment variable to any value
should allow you to run it directly.

Reco


Reply to: