On Wed, 2021-06-30 at 11:41 +0100, Patrick O'Callaghan wrote:
On Tue, 2021-06-29 at 19:37 +0100, Patrick O'Callaghan wrote:
> On Tue, 2021-06-29 at 21:28 +0800, Qiyu Yan wrote:
> > 在 2021-06-29星期二的 12:42 +0100,Patrick O'Callaghan写道:
> > > I'm trying to get a specific service to start on login, and the
> > > usual
> > > method (KDE Autostart) isn't working so I'm trying to do it
> > > with
> > > a
> > > systemd unit:
> >
> > How is that not working? Is it due to systemd-xdg-autostart-
> > generator?
>
> I need to call a command with an argument, but KDE Autostart only
> allows you to specify the name of an executable with no arguments.
> Even
> putting it in a Shell script doesn't work because although the
> script
> is called it immediately terminates, even though the exact same
> command
> when executed from the command line puts itself in the background,
> which is what it's supposed to do.
After re-reading systemd.service(1) I added the line:
Type=forking
to the service file, and now the script is not being terminated,
which
is what I wanted.
IOW, this seems to be the solution, or at least *a* solution. There
may
be an alternate solution using KDE Autostart, but for now I'm
satisfied.
But of course there's always something else. After logging out, the
service is killed, which is fine, but it doesn't start again with a new
login. I assumed that user units would do this automatically, but it
seems they don't.
poc