systemd doesn't recognize init.d status

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











up vote
0
down vote

favorite












I have created systemd script - /etc/systemd/system/test123.service which inside is set to
execute on start/stop the service in /etc/init.d/foo.sh with parameters start/stop,and
foo.sh when started/stopped directly starts/stops the service
The problem I face is, now I want to upgrade to systemd from init.d and when
foo.sh is active ,the systemd script shows to be inactive via the command
"systemctl status test123.service" .Is this behaviour expected or something can be changed
in order systemd to see foo.sh status ?










share|improve this question





















  • You've hand-duplicated a procedure that systemd already does for you. unix.stackexchange.com/a/233581/5132
    – JdeBP
    Sep 13 at 12:13










  • I believe systemd has kind of sys V init compatibility, so I don't think that's a good idea of writing a new service but not deleting original initscript service.Maybe just don't do anything (forget about systemd service file and take advantage of compatibility). Or RTFD and write a new service that call the actual service program and delete foo.sh.
    – ç¥žç§˜å¾·é‡Œå…‹
    Sep 13 at 12:19










  • Yeah I was thinking before starting the systemd ,just to stop and delete the init.d and then cleanly start using systemd?
    – Gordon
    Sep 13 at 12:26














up vote
0
down vote

favorite












I have created systemd script - /etc/systemd/system/test123.service which inside is set to
execute on start/stop the service in /etc/init.d/foo.sh with parameters start/stop,and
foo.sh when started/stopped directly starts/stops the service
The problem I face is, now I want to upgrade to systemd from init.d and when
foo.sh is active ,the systemd script shows to be inactive via the command
"systemctl status test123.service" .Is this behaviour expected or something can be changed
in order systemd to see foo.sh status ?










share|improve this question





















  • You've hand-duplicated a procedure that systemd already does for you. unix.stackexchange.com/a/233581/5132
    – JdeBP
    Sep 13 at 12:13










  • I believe systemd has kind of sys V init compatibility, so I don't think that's a good idea of writing a new service but not deleting original initscript service.Maybe just don't do anything (forget about systemd service file and take advantage of compatibility). Or RTFD and write a new service that call the actual service program and delete foo.sh.
    – ç¥žç§˜å¾·é‡Œå…‹
    Sep 13 at 12:19










  • Yeah I was thinking before starting the systemd ,just to stop and delete the init.d and then cleanly start using systemd?
    – Gordon
    Sep 13 at 12:26












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have created systemd script - /etc/systemd/system/test123.service which inside is set to
execute on start/stop the service in /etc/init.d/foo.sh with parameters start/stop,and
foo.sh when started/stopped directly starts/stops the service
The problem I face is, now I want to upgrade to systemd from init.d and when
foo.sh is active ,the systemd script shows to be inactive via the command
"systemctl status test123.service" .Is this behaviour expected or something can be changed
in order systemd to see foo.sh status ?










share|improve this question













I have created systemd script - /etc/systemd/system/test123.service which inside is set to
execute on start/stop the service in /etc/init.d/foo.sh with parameters start/stop,and
foo.sh when started/stopped directly starts/stops the service
The problem I face is, now I want to upgrade to systemd from init.d and when
foo.sh is active ,the systemd script shows to be inactive via the command
"systemctl status test123.service" .Is this behaviour expected or something can be changed
in order systemd to see foo.sh status ?







systemd systemctl






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Sep 13 at 11:15









Gordon

1




1











  • You've hand-duplicated a procedure that systemd already does for you. unix.stackexchange.com/a/233581/5132
    – JdeBP
    Sep 13 at 12:13










  • I believe systemd has kind of sys V init compatibility, so I don't think that's a good idea of writing a new service but not deleting original initscript service.Maybe just don't do anything (forget about systemd service file and take advantage of compatibility). Or RTFD and write a new service that call the actual service program and delete foo.sh.
    – ç¥žç§˜å¾·é‡Œå…‹
    Sep 13 at 12:19










  • Yeah I was thinking before starting the systemd ,just to stop and delete the init.d and then cleanly start using systemd?
    – Gordon
    Sep 13 at 12:26
















  • You've hand-duplicated a procedure that systemd already does for you. unix.stackexchange.com/a/233581/5132
    – JdeBP
    Sep 13 at 12:13










  • I believe systemd has kind of sys V init compatibility, so I don't think that's a good idea of writing a new service but not deleting original initscript service.Maybe just don't do anything (forget about systemd service file and take advantage of compatibility). Or RTFD and write a new service that call the actual service program and delete foo.sh.
    – ç¥žç§˜å¾·é‡Œå…‹
    Sep 13 at 12:19










  • Yeah I was thinking before starting the systemd ,just to stop and delete the init.d and then cleanly start using systemd?
    – Gordon
    Sep 13 at 12:26















You've hand-duplicated a procedure that systemd already does for you. unix.stackexchange.com/a/233581/5132
– JdeBP
Sep 13 at 12:13




You've hand-duplicated a procedure that systemd already does for you. unix.stackexchange.com/a/233581/5132
– JdeBP
Sep 13 at 12:13












I believe systemd has kind of sys V init compatibility, so I don't think that's a good idea of writing a new service but not deleting original initscript service.Maybe just don't do anything (forget about systemd service file and take advantage of compatibility). Or RTFD and write a new service that call the actual service program and delete foo.sh.
– ç¥žç§˜å¾·é‡Œå…‹
Sep 13 at 12:19




I believe systemd has kind of sys V init compatibility, so I don't think that's a good idea of writing a new service but not deleting original initscript service.Maybe just don't do anything (forget about systemd service file and take advantage of compatibility). Or RTFD and write a new service that call the actual service program and delete foo.sh.
– ç¥žç§˜å¾·é‡Œå…‹
Sep 13 at 12:19












Yeah I was thinking before starting the systemd ,just to stop and delete the init.d and then cleanly start using systemd?
– Gordon
Sep 13 at 12:26




Yeah I was thinking before starting the systemd ,just to stop and delete the init.d and then cleanly start using systemd?
– Gordon
Sep 13 at 12:26










1 Answer
1






active

oldest

votes

















up vote
0
down vote













The .service file and the init script must have the same name, is the initscript is called /etc/init.d/foo the service file must be called foo.service






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%2f468765%2fsystemd-doesnt-recognize-init-d-status%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
    0
    down vote













    The .service file and the init script must have the same name, is the initscript is called /etc/init.d/foo the service file must be called foo.service






    share|improve this answer
























      up vote
      0
      down vote













      The .service file and the init script must have the same name, is the initscript is called /etc/init.d/foo the service file must be called foo.service






      share|improve this answer






















        up vote
        0
        down vote










        up vote
        0
        down vote









        The .service file and the init script must have the same name, is the initscript is called /etc/init.d/foo the service file must be called foo.service






        share|improve this answer












        The .service file and the init script must have the same name, is the initscript is called /etc/init.d/foo the service file must be called foo.service







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Sep 15 at 20:45









        Bigon

        1,188613




        1,188613



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f468765%2fsystemd-doesnt-recognize-init-d-status%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