How to run interdependent services on Linux consecutively?
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I want to run the command FsciBootloader / dev / ttymxc5 /home/root/GwRadioFirmware/KW41Z/KW41Z-hostcontrol-serial-upgrade-v2.0.5.bin
when the system is started for the first time. This command flashes another device via the data UART. I need to run the following command according to the success of this data transfer (flash).
/ usr / bin / ThreadDeviceMgr / dev / ttymxc5 fslthr0 0.
For this, I first created a bash file in the /etc/ file path and added
#! / Bin / bash
echo "stuttering is starting ...."
FsciBootloader / dev / ttymxc5 /home/root/GwRadioFirmware/KW41Z/KW41Z-hostcontrol-serial-upgrade-v2.0.5.bin
echo "write completed ...."
I wrote the commands.
Next, I created a service script in the file path / lib / systemd / system
and wrote the following commands.
[Unit]
Description=Thread network manager
After=gateway-config.service
[Service]
Type=simple
ExecStart=/etc/flashTTT.sh
[Install]
WantedBy=multi-user.target
Then, I created a second service file and in this service file I want to execute the following command according to the result of the command in the first service file and complete the operation.
[Unit]
Description=Thread network manager
After=thread-write.service
[Service]
Type=simple
ExecStart=/usr/bin/ThreadDeviceMgr /dev/ttymxc5 fslthr0 tap 0
[Install]
WantedBy=multi-user.target
- Are the steps I have implemented correct?
- How can I learn that the flashing process is successful?
If I run the services according to the above steps, 2nd service does not start after the flashing and I get the following error.
â thread-control.service - Thread network manager
Loaded: loaded (/lib/systemd/system/thread-control.service; enabled; vendor preset: enabled)
Active: failed (Result: signal) since Wed 2018-05-09 07:15:35 UTC; 9min ago
Process: 392 ExecStart=/usr/bin/ThreadDeviceMgr /dev/ttymxc5 fslthr0 tap 0 (code=killed, signal=SEGV)
Main PID: 392 (code=killed, signal=SEGV) May 09 07:15:32 imx6ulmg ThreadDeviceMgr[392]: RTNETLINK answers: File exists
May 09 07:15:32 imx6ulmg ThreadDeviceMgr[392]: RTNETLINK answers: File exists
May 09 07:15:32 imx6ulmg ThreadDeviceMgr[392]: net.ipv6.conf.all.forwarding = 1
May 09 07:15:32 imx6ulmg /usr/bin/ThreadDeviceMgr[392]: main:3340: Software Version : 1.7.26
May 09 07:15:32 imx6ulmg /usr/bin/ThreadDeviceMgr[392]: TUNAlloc:3179: Entered : TUNAlloc
May 09 07:15:32 imx6ulmg /usr/bin/ThreadDeviceMgr[392]: TUNAlloc:3229: Exited : TUNAlloc
May 09 07:15:32 imx6ulmg /usr/bin/ThreadDeviceMgr[392]: Provision:2852: Entered : Provision
May 09 07:15:35 imx6ulmg systemd[1]: thread-control.service: Main process exited, code=killed, status=11/SEGV
May 09 07:15:35 imx6ulmg systemd[1]: thread-control.service: Unit entered failed state.
May 09 07:15:35 imx6ulmg systemd[1]: thread-control.service: Failed with result 'signal'.
linux bash services
add a comment |Â
up vote
0
down vote
favorite
I want to run the command FsciBootloader / dev / ttymxc5 /home/root/GwRadioFirmware/KW41Z/KW41Z-hostcontrol-serial-upgrade-v2.0.5.bin
when the system is started for the first time. This command flashes another device via the data UART. I need to run the following command according to the success of this data transfer (flash).
/ usr / bin / ThreadDeviceMgr / dev / ttymxc5 fslthr0 0.
For this, I first created a bash file in the /etc/ file path and added
#! / Bin / bash
echo "stuttering is starting ...."
FsciBootloader / dev / ttymxc5 /home/root/GwRadioFirmware/KW41Z/KW41Z-hostcontrol-serial-upgrade-v2.0.5.bin
echo "write completed ...."
I wrote the commands.
Next, I created a service script in the file path / lib / systemd / system
and wrote the following commands.
[Unit]
Description=Thread network manager
After=gateway-config.service
[Service]
Type=simple
ExecStart=/etc/flashTTT.sh
[Install]
WantedBy=multi-user.target
Then, I created a second service file and in this service file I want to execute the following command according to the result of the command in the first service file and complete the operation.
[Unit]
Description=Thread network manager
After=thread-write.service
[Service]
Type=simple
ExecStart=/usr/bin/ThreadDeviceMgr /dev/ttymxc5 fslthr0 tap 0
[Install]
WantedBy=multi-user.target
- Are the steps I have implemented correct?
- How can I learn that the flashing process is successful?
If I run the services according to the above steps, 2nd service does not start after the flashing and I get the following error.
â thread-control.service - Thread network manager
Loaded: loaded (/lib/systemd/system/thread-control.service; enabled; vendor preset: enabled)
Active: failed (Result: signal) since Wed 2018-05-09 07:15:35 UTC; 9min ago
Process: 392 ExecStart=/usr/bin/ThreadDeviceMgr /dev/ttymxc5 fslthr0 tap 0 (code=killed, signal=SEGV)
Main PID: 392 (code=killed, signal=SEGV) May 09 07:15:32 imx6ulmg ThreadDeviceMgr[392]: RTNETLINK answers: File exists
May 09 07:15:32 imx6ulmg ThreadDeviceMgr[392]: RTNETLINK answers: File exists
May 09 07:15:32 imx6ulmg ThreadDeviceMgr[392]: net.ipv6.conf.all.forwarding = 1
May 09 07:15:32 imx6ulmg /usr/bin/ThreadDeviceMgr[392]: main:3340: Software Version : 1.7.26
May 09 07:15:32 imx6ulmg /usr/bin/ThreadDeviceMgr[392]: TUNAlloc:3179: Entered : TUNAlloc
May 09 07:15:32 imx6ulmg /usr/bin/ThreadDeviceMgr[392]: TUNAlloc:3229: Exited : TUNAlloc
May 09 07:15:32 imx6ulmg /usr/bin/ThreadDeviceMgr[392]: Provision:2852: Entered : Provision
May 09 07:15:35 imx6ulmg systemd[1]: thread-control.service: Main process exited, code=killed, status=11/SEGV
May 09 07:15:35 imx6ulmg systemd[1]: thread-control.service: Unit entered failed state.
May 09 07:15:35 imx6ulmg systemd[1]: thread-control.service: Failed with result 'signal'.
linux bash services
1
I dont have an answer but are you sûre about the paths with space. If normal ignore my comment but if not please correct them it makes things harder to read
â Kiwy
May 9 at 7:57
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I want to run the command FsciBootloader / dev / ttymxc5 /home/root/GwRadioFirmware/KW41Z/KW41Z-hostcontrol-serial-upgrade-v2.0.5.bin
when the system is started for the first time. This command flashes another device via the data UART. I need to run the following command according to the success of this data transfer (flash).
/ usr / bin / ThreadDeviceMgr / dev / ttymxc5 fslthr0 0.
For this, I first created a bash file in the /etc/ file path and added
#! / Bin / bash
echo "stuttering is starting ...."
FsciBootloader / dev / ttymxc5 /home/root/GwRadioFirmware/KW41Z/KW41Z-hostcontrol-serial-upgrade-v2.0.5.bin
echo "write completed ...."
I wrote the commands.
Next, I created a service script in the file path / lib / systemd / system
and wrote the following commands.
[Unit]
Description=Thread network manager
After=gateway-config.service
[Service]
Type=simple
ExecStart=/etc/flashTTT.sh
[Install]
WantedBy=multi-user.target
Then, I created a second service file and in this service file I want to execute the following command according to the result of the command in the first service file and complete the operation.
[Unit]
Description=Thread network manager
After=thread-write.service
[Service]
Type=simple
ExecStart=/usr/bin/ThreadDeviceMgr /dev/ttymxc5 fslthr0 tap 0
[Install]
WantedBy=multi-user.target
- Are the steps I have implemented correct?
- How can I learn that the flashing process is successful?
If I run the services according to the above steps, 2nd service does not start after the flashing and I get the following error.
â thread-control.service - Thread network manager
Loaded: loaded (/lib/systemd/system/thread-control.service; enabled; vendor preset: enabled)
Active: failed (Result: signal) since Wed 2018-05-09 07:15:35 UTC; 9min ago
Process: 392 ExecStart=/usr/bin/ThreadDeviceMgr /dev/ttymxc5 fslthr0 tap 0 (code=killed, signal=SEGV)
Main PID: 392 (code=killed, signal=SEGV) May 09 07:15:32 imx6ulmg ThreadDeviceMgr[392]: RTNETLINK answers: File exists
May 09 07:15:32 imx6ulmg ThreadDeviceMgr[392]: RTNETLINK answers: File exists
May 09 07:15:32 imx6ulmg ThreadDeviceMgr[392]: net.ipv6.conf.all.forwarding = 1
May 09 07:15:32 imx6ulmg /usr/bin/ThreadDeviceMgr[392]: main:3340: Software Version : 1.7.26
May 09 07:15:32 imx6ulmg /usr/bin/ThreadDeviceMgr[392]: TUNAlloc:3179: Entered : TUNAlloc
May 09 07:15:32 imx6ulmg /usr/bin/ThreadDeviceMgr[392]: TUNAlloc:3229: Exited : TUNAlloc
May 09 07:15:32 imx6ulmg /usr/bin/ThreadDeviceMgr[392]: Provision:2852: Entered : Provision
May 09 07:15:35 imx6ulmg systemd[1]: thread-control.service: Main process exited, code=killed, status=11/SEGV
May 09 07:15:35 imx6ulmg systemd[1]: thread-control.service: Unit entered failed state.
May 09 07:15:35 imx6ulmg systemd[1]: thread-control.service: Failed with result 'signal'.
linux bash services
I want to run the command FsciBootloader / dev / ttymxc5 /home/root/GwRadioFirmware/KW41Z/KW41Z-hostcontrol-serial-upgrade-v2.0.5.bin
when the system is started for the first time. This command flashes another device via the data UART. I need to run the following command according to the success of this data transfer (flash).
/ usr / bin / ThreadDeviceMgr / dev / ttymxc5 fslthr0 0.
For this, I first created a bash file in the /etc/ file path and added
#! / Bin / bash
echo "stuttering is starting ...."
FsciBootloader / dev / ttymxc5 /home/root/GwRadioFirmware/KW41Z/KW41Z-hostcontrol-serial-upgrade-v2.0.5.bin
echo "write completed ...."
I wrote the commands.
Next, I created a service script in the file path / lib / systemd / system
and wrote the following commands.
[Unit]
Description=Thread network manager
After=gateway-config.service
[Service]
Type=simple
ExecStart=/etc/flashTTT.sh
[Install]
WantedBy=multi-user.target
Then, I created a second service file and in this service file I want to execute the following command according to the result of the command in the first service file and complete the operation.
[Unit]
Description=Thread network manager
After=thread-write.service
[Service]
Type=simple
ExecStart=/usr/bin/ThreadDeviceMgr /dev/ttymxc5 fslthr0 tap 0
[Install]
WantedBy=multi-user.target
- Are the steps I have implemented correct?
- How can I learn that the flashing process is successful?
If I run the services according to the above steps, 2nd service does not start after the flashing and I get the following error.
â thread-control.service - Thread network manager
Loaded: loaded (/lib/systemd/system/thread-control.service; enabled; vendor preset: enabled)
Active: failed (Result: signal) since Wed 2018-05-09 07:15:35 UTC; 9min ago
Process: 392 ExecStart=/usr/bin/ThreadDeviceMgr /dev/ttymxc5 fslthr0 tap 0 (code=killed, signal=SEGV)
Main PID: 392 (code=killed, signal=SEGV) May 09 07:15:32 imx6ulmg ThreadDeviceMgr[392]: RTNETLINK answers: File exists
May 09 07:15:32 imx6ulmg ThreadDeviceMgr[392]: RTNETLINK answers: File exists
May 09 07:15:32 imx6ulmg ThreadDeviceMgr[392]: net.ipv6.conf.all.forwarding = 1
May 09 07:15:32 imx6ulmg /usr/bin/ThreadDeviceMgr[392]: main:3340: Software Version : 1.7.26
May 09 07:15:32 imx6ulmg /usr/bin/ThreadDeviceMgr[392]: TUNAlloc:3179: Entered : TUNAlloc
May 09 07:15:32 imx6ulmg /usr/bin/ThreadDeviceMgr[392]: TUNAlloc:3229: Exited : TUNAlloc
May 09 07:15:32 imx6ulmg /usr/bin/ThreadDeviceMgr[392]: Provision:2852: Entered : Provision
May 09 07:15:35 imx6ulmg systemd[1]: thread-control.service: Main process exited, code=killed, status=11/SEGV
May 09 07:15:35 imx6ulmg systemd[1]: thread-control.service: Unit entered failed state.
May 09 07:15:35 imx6ulmg systemd[1]: thread-control.service: Failed with result 'signal'.
linux bash services
edited May 9 at 8:28
Eranda Peiris
307113
307113
asked May 9 at 7:36
Zafer M. Ã ÂEN
1
1
1
I dont have an answer but are you sûre about the paths with space. If normal ignore my comment but if not please correct them it makes things harder to read
â Kiwy
May 9 at 7:57
add a comment |Â
1
I dont have an answer but are you sûre about the paths with space. If normal ignore my comment but if not please correct them it makes things harder to read
â Kiwy
May 9 at 7:57
1
1
I dont have an answer but are you sûre about the paths with space. If normal ignore my comment but if not please correct them it makes things harder to read
â Kiwy
May 9 at 7:57
I dont have an answer but are you sûre about the paths with space. If normal ignore my comment but if not please correct them it makes things harder to read
â Kiwy
May 9 at 7:57
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f442700%2fhow-to-run-interdependent-services-on-linux-consecutively%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
I dont have an answer but are you sûre about the paths with space. If normal ignore my comment but if not please correct them it makes things harder to read
â Kiwy
May 9 at 7:57