How to run interdependent services on Linux consecutively?

The name of the pictureThe name of the pictureThe name of the pictureClash 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


  1. Are the steps I have implemented correct?

  2. How can I learn that the flashing process is successful?


  3. 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'.







share|improve this question

















  • 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














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


  1. Are the steps I have implemented correct?

  2. How can I learn that the flashing process is successful?


  3. 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'.







share|improve this question

















  • 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












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


  1. Are the steps I have implemented correct?

  2. How can I learn that the flashing process is successful?


  3. 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'.







share|improve this question













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


  1. Are the steps I have implemented correct?

  2. How can I learn that the flashing process is successful?


  3. 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'.









share|improve this question












share|improve this question




share|improve this question








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












  • 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















active

oldest

votes











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%2f442700%2fhow-to-run-interdependent-services-on-linux-consecutively%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes










 

draft saved


draft discarded


























 


draft saved


draft discarded














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













































































Popular posts from this blog

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

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?