0

Trying to run

#!/bin/sh
# byobu_launcher.sh ver 20170915122301 Copyright 2017 alexx, MIT Licence ver 1.0

byobu new-session -d -s $USER

# mongod
byobu new-window -t $USER:1 -n 'MLT'
byobu send-keys "/home/username/scripts/mlt.sh" C-m

I'm using this template with the correct info put in

.

[Unit] Description=byobu

[Service] ExecStart=/root/scripts/byobu.sh Restart=always

[Install] WantedBy=multi-user.target

After starting the service I get this error

Apr 30 14:36:29 ubuntu byobu.sh[4141]: Cannot run byobu because [] does not own []
Apr 30 14:36:29 ubuntu byobu.sh[4141]: Cannot run byobu because [] does not own []
Apr 30 14:36:29 ubuntu byobu.sh[4141]: Cannot run byobu because [] does not own []

Not sure how to fix or change the ownership.

Strangely it works on rc.local, but I think getting it to work on Systemd would be better.

0

You are using the $USER variable but systemd has not set it. It only set when you use the User= directive.

If you want to run your service as root, then you would add User=root to your [Service] section.

Related documentation for this in Environment Variables in Spawned Processes in the systemd.exec man page.

  • Thanks so much. I needed to add your part and another variable called – snickerpop May 1 '18 at 15:48
  • Thanks so much. I needed to add your part and another variable called. RemainAfterExit=yes. The code works with what I have below. – snickerpop May 1 '18 at 15:56
0

This code works now

[Unit] Description=MFC Byobu After=network.target

[Service] ExecStart=/root/scripts/byobu.sh User=root Restart=always RemainAfterExit=yes

[Install] WantedBy=multi-user.target

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.