systemd service does not trigger the tmux command upon reboot

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I am using a Yocto image based on the linux-mainline kernel. I have systemd on the embedded OS that I have created.



Aim



I have a UMTS dongle connected to the board which will use usb_modeswitch to recognise the dongle and wvdial to connect to the 3G insfrastructure.



Method



I wrote a simple bash script in /usr/umts.sh as follows



#!/bin/bash

sleep 1;
usb_modeswitch --default-vendor 12d1 --default-product 1446 -J

sleep 1;
/usr/bin/tmux new-session -d -s Cloud
/usr/bin/tmux set-option set-remain-on-exit on
/usr/bin/tmux new-window -d -n 'wvdial' -t Cloud:1 'sleep 1; /usr/bin/wvdialconf; /usr/bin/wvdial';


usb_modeswitch will configure the USB Dongle and the next part will create a tmux session and trigger wvdial within.



my systemd script looks like follows in /etc/systemd/system/enable-umts.service



GNU nano 2.2.5 File: /etc/systemd/system/enable-umts.service



[Unit]
Description=Enable UMTS Dongle for Cloud Connectivity

[Service]
Type=oneshot
ExecStart=/usr/umts.sh

[Install]
WantedBy=default.target


(I have given execution rights to the script using chmod +x /usr/umts.sh)



I reloaded the daemon systemctl daemon-reload and enabled the service systemctl enable enable-umts.service



and rebooted the board (NOTE: I have only root on board and no other user)



The dmesg infact triggers the usb_modeswitch from the script above and I see related messages



[ OK ] Started Enable UMTS Dongle for Cloud Connectivity.
[ 13.051247] scsi host2: usb-storage 1-1:1.5
[ 13.067326] usb-storage 1-1:1.6: USB Mass Storage device detected
[ 13.074645] scsi host3: usb-storage 1-1:1.6
[ 13.158627] usbcore: registered new interface driver usbserial
[ 13.165501] usbcore: registered new interface driver usbserial_generic
[ 13.174754] usbserial: USB Serial support registered for generic
[ 13.202356] usbcore: registered new interface driver option
[ 13.208714] usbserial: USB Serial support registered for GSM modem (1-port)
[ 13.216468] option 1-1:1.0: GSM modem (1-port) converter detected
[ 13.229840] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
[ 13.238774] option 1-1:1.3: GSM modem (1-port) converter detected
[ 13.248906] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
[ 13.256172] option 1-1:1.4: GSM modem (1-port) converter detected
[ 13.264467] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2
[ 14.069960] scsi 2:0:0:0: CD-ROM HUAWEI Mass Storage 2.31 PQ: 0 ANSI: 2
[ 14.088684] scsi 3:0:0:0: Direct-Access HUAWEI TF CARD Storage PQ: 0 ANSI: 2
[ 14.127686] sd 3:0:0:0: [sda] Attached SCSI removable disk
GSM modem (1-port) converter detected
] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
[ 13.238774] option 1-1:1.3: GSM modem (1-port) converter detected
[ 13.248906] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
[ 13.256172] option 1-1:1.4: GSM modem (1-port) coPassword


But upon login I try to list the sessions tmux ls and it states there are no sessions created.



The `script in fact does not fail and the service status is as follows:



● enable-umts.service - Enable UMTS Dongle for Cloud Connectivity
Loaded: loaded (/etc/systemd/system/enable-umts.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Thu 2018-05-17 12:52:10 UTC; 4min 51s ago
Process: 214 ExecStart=/usr/umts.sh (code=exited, status=0/SUCCESS)
Main PID: 214 (code=exited, status=0/SUCCESS)

May 17 12:52:09 phyboard-mira-imx6-3 umts.sh[214]: Set up interface 0
May 17 12:52:09 phyboard-mira-imx6-3 umts.sh[214]: Use endpoint 0x01 for message sending ...
May 17 12:52:09 phyboard-mira-imx6-3 umts.sh[214]: Trying to send message 1 to endpoint 0x01 ...
May 17 12:52:09 phyboard-mira-imx6-3 umts.sh[214]: OK, message successfully sent
May 17 12:52:09 phyboard-mira-imx6-3 umts.sh[214]: Reset response endpoint 0x81
May 17 12:52:09 phyboard-mira-imx6-3 umts.sh[214]: Reset message endpoint 0x01
May 17 12:52:09 phyboard-mira-imx6-3 umts.sh[214]: Could not reset endpoint (probably harmless): -99
May 17 12:52:09 phyboard-mira-imx6-3 umts.sh[214]: Device is gone, skip any further commands
May 17 12:52:09 phyboard-mira-imx6-3 umts.sh[214]: -> Run lsusb to note any changes. Bye!
May 17 12:52:10 phyboard-mira-imx6-3 systemd[1]: Started Enable UMTS Dongle for Cloud Connectivity.


If execute the script /usr/umts.sh as a standalone script then in fact it does everything it is supposed to do (open a new tmux session and triggers wvdial)



What is wrong here? I tried adding more sleep time but that isn't working either. Sadly there is no rc.local or cron available for the yocto image I am working on.







share|improve this question



















  • You can try using tmux -v .... It will create 2 files tmux-* in the current directory of the command. This log is very verbose and not very comprehensible but may give a clue as to why it fails, or even if it ran.
    – meuh
    May 17 at 14:11






  • 1




    I added RemainAfterExit=true in my systemd script and now it works.
    – Shan-Desai
    May 17 at 14:32














up vote
0
down vote

favorite












I am using a Yocto image based on the linux-mainline kernel. I have systemd on the embedded OS that I have created.



Aim



I have a UMTS dongle connected to the board which will use usb_modeswitch to recognise the dongle and wvdial to connect to the 3G insfrastructure.



Method



I wrote a simple bash script in /usr/umts.sh as follows



#!/bin/bash

sleep 1;
usb_modeswitch --default-vendor 12d1 --default-product 1446 -J

sleep 1;
/usr/bin/tmux new-session -d -s Cloud
/usr/bin/tmux set-option set-remain-on-exit on
/usr/bin/tmux new-window -d -n 'wvdial' -t Cloud:1 'sleep 1; /usr/bin/wvdialconf; /usr/bin/wvdial';


usb_modeswitch will configure the USB Dongle and the next part will create a tmux session and trigger wvdial within.



my systemd script looks like follows in /etc/systemd/system/enable-umts.service



GNU nano 2.2.5 File: /etc/systemd/system/enable-umts.service



[Unit]
Description=Enable UMTS Dongle for Cloud Connectivity

[Service]
Type=oneshot
ExecStart=/usr/umts.sh

[Install]
WantedBy=default.target


(I have given execution rights to the script using chmod +x /usr/umts.sh)



I reloaded the daemon systemctl daemon-reload and enabled the service systemctl enable enable-umts.service



and rebooted the board (NOTE: I have only root on board and no other user)



The dmesg infact triggers the usb_modeswitch from the script above and I see related messages



[ OK ] Started Enable UMTS Dongle for Cloud Connectivity.
[ 13.051247] scsi host2: usb-storage 1-1:1.5
[ 13.067326] usb-storage 1-1:1.6: USB Mass Storage device detected
[ 13.074645] scsi host3: usb-storage 1-1:1.6
[ 13.158627] usbcore: registered new interface driver usbserial
[ 13.165501] usbcore: registered new interface driver usbserial_generic
[ 13.174754] usbserial: USB Serial support registered for generic
[ 13.202356] usbcore: registered new interface driver option
[ 13.208714] usbserial: USB Serial support registered for GSM modem (1-port)
[ 13.216468] option 1-1:1.0: GSM modem (1-port) converter detected
[ 13.229840] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
[ 13.238774] option 1-1:1.3: GSM modem (1-port) converter detected
[ 13.248906] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
[ 13.256172] option 1-1:1.4: GSM modem (1-port) converter detected
[ 13.264467] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2
[ 14.069960] scsi 2:0:0:0: CD-ROM HUAWEI Mass Storage 2.31 PQ: 0 ANSI: 2
[ 14.088684] scsi 3:0:0:0: Direct-Access HUAWEI TF CARD Storage PQ: 0 ANSI: 2
[ 14.127686] sd 3:0:0:0: [sda] Attached SCSI removable disk
GSM modem (1-port) converter detected
] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
[ 13.238774] option 1-1:1.3: GSM modem (1-port) converter detected
[ 13.248906] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
[ 13.256172] option 1-1:1.4: GSM modem (1-port) coPassword


But upon login I try to list the sessions tmux ls and it states there are no sessions created.



The `script in fact does not fail and the service status is as follows:



● enable-umts.service - Enable UMTS Dongle for Cloud Connectivity
Loaded: loaded (/etc/systemd/system/enable-umts.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Thu 2018-05-17 12:52:10 UTC; 4min 51s ago
Process: 214 ExecStart=/usr/umts.sh (code=exited, status=0/SUCCESS)
Main PID: 214 (code=exited, status=0/SUCCESS)

May 17 12:52:09 phyboard-mira-imx6-3 umts.sh[214]: Set up interface 0
May 17 12:52:09 phyboard-mira-imx6-3 umts.sh[214]: Use endpoint 0x01 for message sending ...
May 17 12:52:09 phyboard-mira-imx6-3 umts.sh[214]: Trying to send message 1 to endpoint 0x01 ...
May 17 12:52:09 phyboard-mira-imx6-3 umts.sh[214]: OK, message successfully sent
May 17 12:52:09 phyboard-mira-imx6-3 umts.sh[214]: Reset response endpoint 0x81
May 17 12:52:09 phyboard-mira-imx6-3 umts.sh[214]: Reset message endpoint 0x01
May 17 12:52:09 phyboard-mira-imx6-3 umts.sh[214]: Could not reset endpoint (probably harmless): -99
May 17 12:52:09 phyboard-mira-imx6-3 umts.sh[214]: Device is gone, skip any further commands
May 17 12:52:09 phyboard-mira-imx6-3 umts.sh[214]: -> Run lsusb to note any changes. Bye!
May 17 12:52:10 phyboard-mira-imx6-3 systemd[1]: Started Enable UMTS Dongle for Cloud Connectivity.


If execute the script /usr/umts.sh as a standalone script then in fact it does everything it is supposed to do (open a new tmux session and triggers wvdial)



What is wrong here? I tried adding more sleep time but that isn't working either. Sadly there is no rc.local or cron available for the yocto image I am working on.







share|improve this question



















  • You can try using tmux -v .... It will create 2 files tmux-* in the current directory of the command. This log is very verbose and not very comprehensible but may give a clue as to why it fails, or even if it ran.
    – meuh
    May 17 at 14:11






  • 1




    I added RemainAfterExit=true in my systemd script and now it works.
    – Shan-Desai
    May 17 at 14:32












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I am using a Yocto image based on the linux-mainline kernel. I have systemd on the embedded OS that I have created.



Aim



I have a UMTS dongle connected to the board which will use usb_modeswitch to recognise the dongle and wvdial to connect to the 3G insfrastructure.



Method



I wrote a simple bash script in /usr/umts.sh as follows



#!/bin/bash

sleep 1;
usb_modeswitch --default-vendor 12d1 --default-product 1446 -J

sleep 1;
/usr/bin/tmux new-session -d -s Cloud
/usr/bin/tmux set-option set-remain-on-exit on
/usr/bin/tmux new-window -d -n 'wvdial' -t Cloud:1 'sleep 1; /usr/bin/wvdialconf; /usr/bin/wvdial';


usb_modeswitch will configure the USB Dongle and the next part will create a tmux session and trigger wvdial within.



my systemd script looks like follows in /etc/systemd/system/enable-umts.service



GNU nano 2.2.5 File: /etc/systemd/system/enable-umts.service



[Unit]
Description=Enable UMTS Dongle for Cloud Connectivity

[Service]
Type=oneshot
ExecStart=/usr/umts.sh

[Install]
WantedBy=default.target


(I have given execution rights to the script using chmod +x /usr/umts.sh)



I reloaded the daemon systemctl daemon-reload and enabled the service systemctl enable enable-umts.service



and rebooted the board (NOTE: I have only root on board and no other user)



The dmesg infact triggers the usb_modeswitch from the script above and I see related messages



[ OK ] Started Enable UMTS Dongle for Cloud Connectivity.
[ 13.051247] scsi host2: usb-storage 1-1:1.5
[ 13.067326] usb-storage 1-1:1.6: USB Mass Storage device detected
[ 13.074645] scsi host3: usb-storage 1-1:1.6
[ 13.158627] usbcore: registered new interface driver usbserial
[ 13.165501] usbcore: registered new interface driver usbserial_generic
[ 13.174754] usbserial: USB Serial support registered for generic
[ 13.202356] usbcore: registered new interface driver option
[ 13.208714] usbserial: USB Serial support registered for GSM modem (1-port)
[ 13.216468] option 1-1:1.0: GSM modem (1-port) converter detected
[ 13.229840] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
[ 13.238774] option 1-1:1.3: GSM modem (1-port) converter detected
[ 13.248906] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
[ 13.256172] option 1-1:1.4: GSM modem (1-port) converter detected
[ 13.264467] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2
[ 14.069960] scsi 2:0:0:0: CD-ROM HUAWEI Mass Storage 2.31 PQ: 0 ANSI: 2
[ 14.088684] scsi 3:0:0:0: Direct-Access HUAWEI TF CARD Storage PQ: 0 ANSI: 2
[ 14.127686] sd 3:0:0:0: [sda] Attached SCSI removable disk
GSM modem (1-port) converter detected
] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
[ 13.238774] option 1-1:1.3: GSM modem (1-port) converter detected
[ 13.248906] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
[ 13.256172] option 1-1:1.4: GSM modem (1-port) coPassword


But upon login I try to list the sessions tmux ls and it states there are no sessions created.



The `script in fact does not fail and the service status is as follows:



● enable-umts.service - Enable UMTS Dongle for Cloud Connectivity
Loaded: loaded (/etc/systemd/system/enable-umts.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Thu 2018-05-17 12:52:10 UTC; 4min 51s ago
Process: 214 ExecStart=/usr/umts.sh (code=exited, status=0/SUCCESS)
Main PID: 214 (code=exited, status=0/SUCCESS)

May 17 12:52:09 phyboard-mira-imx6-3 umts.sh[214]: Set up interface 0
May 17 12:52:09 phyboard-mira-imx6-3 umts.sh[214]: Use endpoint 0x01 for message sending ...
May 17 12:52:09 phyboard-mira-imx6-3 umts.sh[214]: Trying to send message 1 to endpoint 0x01 ...
May 17 12:52:09 phyboard-mira-imx6-3 umts.sh[214]: OK, message successfully sent
May 17 12:52:09 phyboard-mira-imx6-3 umts.sh[214]: Reset response endpoint 0x81
May 17 12:52:09 phyboard-mira-imx6-3 umts.sh[214]: Reset message endpoint 0x01
May 17 12:52:09 phyboard-mira-imx6-3 umts.sh[214]: Could not reset endpoint (probably harmless): -99
May 17 12:52:09 phyboard-mira-imx6-3 umts.sh[214]: Device is gone, skip any further commands
May 17 12:52:09 phyboard-mira-imx6-3 umts.sh[214]: -> Run lsusb to note any changes. Bye!
May 17 12:52:10 phyboard-mira-imx6-3 systemd[1]: Started Enable UMTS Dongle for Cloud Connectivity.


If execute the script /usr/umts.sh as a standalone script then in fact it does everything it is supposed to do (open a new tmux session and triggers wvdial)



What is wrong here? I tried adding more sleep time but that isn't working either. Sadly there is no rc.local or cron available for the yocto image I am working on.







share|improve this question











I am using a Yocto image based on the linux-mainline kernel. I have systemd on the embedded OS that I have created.



Aim



I have a UMTS dongle connected to the board which will use usb_modeswitch to recognise the dongle and wvdial to connect to the 3G insfrastructure.



Method



I wrote a simple bash script in /usr/umts.sh as follows



#!/bin/bash

sleep 1;
usb_modeswitch --default-vendor 12d1 --default-product 1446 -J

sleep 1;
/usr/bin/tmux new-session -d -s Cloud
/usr/bin/tmux set-option set-remain-on-exit on
/usr/bin/tmux new-window -d -n 'wvdial' -t Cloud:1 'sleep 1; /usr/bin/wvdialconf; /usr/bin/wvdial';


usb_modeswitch will configure the USB Dongle and the next part will create a tmux session and trigger wvdial within.



my systemd script looks like follows in /etc/systemd/system/enable-umts.service



GNU nano 2.2.5 File: /etc/systemd/system/enable-umts.service



[Unit]
Description=Enable UMTS Dongle for Cloud Connectivity

[Service]
Type=oneshot
ExecStart=/usr/umts.sh

[Install]
WantedBy=default.target


(I have given execution rights to the script using chmod +x /usr/umts.sh)



I reloaded the daemon systemctl daemon-reload and enabled the service systemctl enable enable-umts.service



and rebooted the board (NOTE: I have only root on board and no other user)



The dmesg infact triggers the usb_modeswitch from the script above and I see related messages



[ OK ] Started Enable UMTS Dongle for Cloud Connectivity.
[ 13.051247] scsi host2: usb-storage 1-1:1.5
[ 13.067326] usb-storage 1-1:1.6: USB Mass Storage device detected
[ 13.074645] scsi host3: usb-storage 1-1:1.6
[ 13.158627] usbcore: registered new interface driver usbserial
[ 13.165501] usbcore: registered new interface driver usbserial_generic
[ 13.174754] usbserial: USB Serial support registered for generic
[ 13.202356] usbcore: registered new interface driver option
[ 13.208714] usbserial: USB Serial support registered for GSM modem (1-port)
[ 13.216468] option 1-1:1.0: GSM modem (1-port) converter detected
[ 13.229840] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
[ 13.238774] option 1-1:1.3: GSM modem (1-port) converter detected
[ 13.248906] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
[ 13.256172] option 1-1:1.4: GSM modem (1-port) converter detected
[ 13.264467] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2
[ 14.069960] scsi 2:0:0:0: CD-ROM HUAWEI Mass Storage 2.31 PQ: 0 ANSI: 2
[ 14.088684] scsi 3:0:0:0: Direct-Access HUAWEI TF CARD Storage PQ: 0 ANSI: 2
[ 14.127686] sd 3:0:0:0: [sda] Attached SCSI removable disk
GSM modem (1-port) converter detected
] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
[ 13.238774] option 1-1:1.3: GSM modem (1-port) converter detected
[ 13.248906] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
[ 13.256172] option 1-1:1.4: GSM modem (1-port) coPassword


But upon login I try to list the sessions tmux ls and it states there are no sessions created.



The `script in fact does not fail and the service status is as follows:



● enable-umts.service - Enable UMTS Dongle for Cloud Connectivity
Loaded: loaded (/etc/systemd/system/enable-umts.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Thu 2018-05-17 12:52:10 UTC; 4min 51s ago
Process: 214 ExecStart=/usr/umts.sh (code=exited, status=0/SUCCESS)
Main PID: 214 (code=exited, status=0/SUCCESS)

May 17 12:52:09 phyboard-mira-imx6-3 umts.sh[214]: Set up interface 0
May 17 12:52:09 phyboard-mira-imx6-3 umts.sh[214]: Use endpoint 0x01 for message sending ...
May 17 12:52:09 phyboard-mira-imx6-3 umts.sh[214]: Trying to send message 1 to endpoint 0x01 ...
May 17 12:52:09 phyboard-mira-imx6-3 umts.sh[214]: OK, message successfully sent
May 17 12:52:09 phyboard-mira-imx6-3 umts.sh[214]: Reset response endpoint 0x81
May 17 12:52:09 phyboard-mira-imx6-3 umts.sh[214]: Reset message endpoint 0x01
May 17 12:52:09 phyboard-mira-imx6-3 umts.sh[214]: Could not reset endpoint (probably harmless): -99
May 17 12:52:09 phyboard-mira-imx6-3 umts.sh[214]: Device is gone, skip any further commands
May 17 12:52:09 phyboard-mira-imx6-3 umts.sh[214]: -> Run lsusb to note any changes. Bye!
May 17 12:52:10 phyboard-mira-imx6-3 systemd[1]: Started Enable UMTS Dongle for Cloud Connectivity.


If execute the script /usr/umts.sh as a standalone script then in fact it does everything it is supposed to do (open a new tmux session and triggers wvdial)



What is wrong here? I tried adding more sleep time but that isn't working either. Sadly there is no rc.local or cron available for the yocto image I am working on.









share|improve this question










share|improve this question




share|improve this question









asked May 17 at 12:56









Shan-Desai

3471312




3471312











  • You can try using tmux -v .... It will create 2 files tmux-* in the current directory of the command. This log is very verbose and not very comprehensible but may give a clue as to why it fails, or even if it ran.
    – meuh
    May 17 at 14:11






  • 1




    I added RemainAfterExit=true in my systemd script and now it works.
    – Shan-Desai
    May 17 at 14:32
















  • You can try using tmux -v .... It will create 2 files tmux-* in the current directory of the command. This log is very verbose and not very comprehensible but may give a clue as to why it fails, or even if it ran.
    – meuh
    May 17 at 14:11






  • 1




    I added RemainAfterExit=true in my systemd script and now it works.
    – Shan-Desai
    May 17 at 14:32















You can try using tmux -v .... It will create 2 files tmux-* in the current directory of the command. This log is very verbose and not very comprehensible but may give a clue as to why it fails, or even if it ran.
– meuh
May 17 at 14:11




You can try using tmux -v .... It will create 2 files tmux-* in the current directory of the command. This log is very verbose and not very comprehensible but may give a clue as to why it fails, or even if it ran.
– meuh
May 17 at 14:11




1




1




I added RemainAfterExit=true in my systemd script and now it works.
– Shan-Desai
May 17 at 14:32




I added RemainAfterExit=true in my systemd script and now it works.
– Shan-Desai
May 17 at 14:32










1 Answer
1






active

oldest

votes

















up vote
1
down vote













I added RemainAfterExit=yes|true in my systemd Script as follows:



[Unit]
Description=Enable UMTS Dongle for Cloud Connectivity

[Service]
Type=oneshot
ExecStart=/usr/umts.sh
RemainAfterExit=true
[Install]
WantedBy=default.target


Added full paths to the umts.sh script as follows:



#!/bin/bash

sleep 1;
/usr/bin/tmux new-session -d -s Cloud
/usr/bin/tmux set-option set-remain-on-exit on
/usr/bin/tmux new-window -d -n 'usb_modeswitch' -t Cloud:2 '/usr/sbin/usb_modeswitch --default-vendor 12d1 --default-product 1446 -J';

/usr/bin/tmux new-window -d -n 'wvdial' -t Cloud:1 'sleep 10; /usr/bin/wvdialconf; /usr/bin/wvdial';


Reloaded the daemon



systemctl daemon-reload



and rebooted the board. and Found the tmux sessions created and running perfectly






share|improve this answer























    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );








     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f444363%2fsystemd-service-does-not-trigger-the-tmux-command-upon-reboot%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote













    I added RemainAfterExit=yes|true in my systemd Script as follows:



    [Unit]
    Description=Enable UMTS Dongle for Cloud Connectivity

    [Service]
    Type=oneshot
    ExecStart=/usr/umts.sh
    RemainAfterExit=true
    [Install]
    WantedBy=default.target


    Added full paths to the umts.sh script as follows:



    #!/bin/bash

    sleep 1;
    /usr/bin/tmux new-session -d -s Cloud
    /usr/bin/tmux set-option set-remain-on-exit on
    /usr/bin/tmux new-window -d -n 'usb_modeswitch' -t Cloud:2 '/usr/sbin/usb_modeswitch --default-vendor 12d1 --default-product 1446 -J';

    /usr/bin/tmux new-window -d -n 'wvdial' -t Cloud:1 'sleep 10; /usr/bin/wvdialconf; /usr/bin/wvdial';


    Reloaded the daemon



    systemctl daemon-reload



    and rebooted the board. and Found the tmux sessions created and running perfectly






    share|improve this answer



























      up vote
      1
      down vote













      I added RemainAfterExit=yes|true in my systemd Script as follows:



      [Unit]
      Description=Enable UMTS Dongle for Cloud Connectivity

      [Service]
      Type=oneshot
      ExecStart=/usr/umts.sh
      RemainAfterExit=true
      [Install]
      WantedBy=default.target


      Added full paths to the umts.sh script as follows:



      #!/bin/bash

      sleep 1;
      /usr/bin/tmux new-session -d -s Cloud
      /usr/bin/tmux set-option set-remain-on-exit on
      /usr/bin/tmux new-window -d -n 'usb_modeswitch' -t Cloud:2 '/usr/sbin/usb_modeswitch --default-vendor 12d1 --default-product 1446 -J';

      /usr/bin/tmux new-window -d -n 'wvdial' -t Cloud:1 'sleep 10; /usr/bin/wvdialconf; /usr/bin/wvdial';


      Reloaded the daemon



      systemctl daemon-reload



      and rebooted the board. and Found the tmux sessions created and running perfectly






      share|improve this answer

























        up vote
        1
        down vote










        up vote
        1
        down vote









        I added RemainAfterExit=yes|true in my systemd Script as follows:



        [Unit]
        Description=Enable UMTS Dongle for Cloud Connectivity

        [Service]
        Type=oneshot
        ExecStart=/usr/umts.sh
        RemainAfterExit=true
        [Install]
        WantedBy=default.target


        Added full paths to the umts.sh script as follows:



        #!/bin/bash

        sleep 1;
        /usr/bin/tmux new-session -d -s Cloud
        /usr/bin/tmux set-option set-remain-on-exit on
        /usr/bin/tmux new-window -d -n 'usb_modeswitch' -t Cloud:2 '/usr/sbin/usb_modeswitch --default-vendor 12d1 --default-product 1446 -J';

        /usr/bin/tmux new-window -d -n 'wvdial' -t Cloud:1 'sleep 10; /usr/bin/wvdialconf; /usr/bin/wvdial';


        Reloaded the daemon



        systemctl daemon-reload



        and rebooted the board. and Found the tmux sessions created and running perfectly






        share|improve this answer















        I added RemainAfterExit=yes|true in my systemd Script as follows:



        [Unit]
        Description=Enable UMTS Dongle for Cloud Connectivity

        [Service]
        Type=oneshot
        ExecStart=/usr/umts.sh
        RemainAfterExit=true
        [Install]
        WantedBy=default.target


        Added full paths to the umts.sh script as follows:



        #!/bin/bash

        sleep 1;
        /usr/bin/tmux new-session -d -s Cloud
        /usr/bin/tmux set-option set-remain-on-exit on
        /usr/bin/tmux new-window -d -n 'usb_modeswitch' -t Cloud:2 '/usr/sbin/usb_modeswitch --default-vendor 12d1 --default-product 1446 -J';

        /usr/bin/tmux new-window -d -n 'wvdial' -t Cloud:1 'sleep 10; /usr/bin/wvdialconf; /usr/bin/wvdial';


        Reloaded the daemon



        systemctl daemon-reload



        and rebooted the board. and Found the tmux sessions created and running perfectly







        share|improve this answer















        share|improve this answer



        share|improve this answer








        edited May 20 at 16:09


























        answered May 17 at 14:36









        Shan-Desai

        3471312




        3471312






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f444363%2fsystemd-service-does-not-trigger-the-tmux-command-upon-reboot%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Bahrain

            Postfix configuration issue with fips on centos 7; mailgun relay