You are not logged in.
I'd like to create a screen session with weechat running on boot. I figgured i'd use systemd for it, but can't get it to work and am sure i am overlooking something simple (such as user env?)
the script i am trying to start is:
/home/nuccy/scritps/weechat.sh
#!/bin/sh
bash -c '/usr/bin/screen-4.8.0 -dmS weechat sh'
bash -c "/usr/bin/screen-4.8.0 -S weechat -X stuff 'weechat'$(echo -ne '\015')"The script seems to work when i run it from my use enviorment / console. However if i run it from systemd it just kind of disapears. I've tryed to do it as regular root and start use User=nuccy but also as a --user service.
I know i am missing something simple, but can you lads point me in the right direction?
the .service files run fine and just stay active, so that can't be it.
Last edited by BottleNeck (2021-02-17 21:52:13)
Offline
Maybe you could post the service file so we can take a look?
sys2064
Offline
You run detached bash sessions that are killed immediately as your script completes. You'll want to have it of Type=forking for spawned processes to remain at the very least and maybe also read the specialized snippet in https://wiki.archlinux.org/index.php/Sy … ultiplexer
Offline
cat /home/nuccy/.config/systemd/user/weechatuser.service <--- tryed this one as user (systemctl --user start weechatuser)
[Unit]
Description=WeechatScreenSession
Wants=network.target
After=network.target
[Service]
ExecStart=/usr/bin/env HOME=/home/nuccy /home/nuccy/scripts/weechat.sh
[Install]
WantedBy=multi-user.targetresult:
systemctl --user status weechatuser
● weechatuser.service - WeechatScreenSession
Loaded: loaded (/home/nuccy/.config/systemd/user/weechatuser.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Feb 17 22:42:23 nuccy systemd[526]: Started WeechatScreenSession.
Feb 17 22:42:23 nuccy systemd[526]: weechatuser.service: Succeeded.also tryed as a system service:
cat /etc/systemd/system/weechat.service
[Unit]
Description=WeechatScreenSession
Wants=network.target
After=network.target
[Service]
User=nuccy
Group=nuccy
ExecStart=/home/nuccy/scripts/weechat.sh
[Install]
WantedBy=multi-user.targetwith result:
sudo systemctl status weechat
● weechat.service - WeechatScreenSession
Loaded: loaded (/etc/systemd/system/weechat.service; disabled; vendor preset: disabled)
Active: inactive (dead)
Feb 17 22:43:24 nuccy systemd[1]: Started WeechatScreenSession.
Feb 17 22:43:24 nuccy systemd[1]: weechat.service: Succeeded.sorry, skipped that one being so convinced i was doing something more general and logical wrongly.
Last edited by BottleNeck (2021-02-17 21:49:13)
Offline
You run detached bash sessions that are killed immediately as your script completes. You'll want to have it of Type=forking for spawned processes to remain at the very least and maybe also read the specialized snippet in https://wiki.archlinux.org/index.php/Sy … ultiplexer
that was it, thanks. See something so simple i overlooked ![]()
Offline