Trying to setup user systemd service: Loaded: not-found (Reason: No such file or directory)

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








up vote
0
down vote

favorite












I'm trying to make a user systemd service that runs a python script - however, when I try starting the service with systemctl --user start shadesmath, and then do systemctl status shadesmath, I get:



● shadesmath.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)


Here is the contents of my shadesmath.service file, which has been placed in ~/.config/systemd/user/shadesmath.service with permissions 744:



[Unit]
Description=ShadesMath
AssertPathExists=/home/mikel/bots/mathbot/mathbot

[Service]
WorkingDirectory=/home/mikel/bots/mathbot/mathbot
ExecStart=/home/mikel/anaconda3/bin/python bot.py parameters.json
Restart=always

[Install]
WantedBy=default.target


I tried running systemctl --user enable shadesmath, which created a symlink to the service in ~/.config/user/systemd/default.target.wants, but this hasn't seemed to change anything when I try starting the service.



This is my first time trying to use systemd, so chances are I'm doing something stupid, but I can't figure out what the issue is. Any pointers on how to set this up would be much appreciated. My goal is to have a service that runs this python script, and to re-run it on startup/if the script finishes or crashes - ideally I want this to be a user service as I don't want this running as root.










share|improve this question





















  • The issue seems to have fixed itself with some more fiddling (redoing the steps in the question) but unfortunately I don't know what actually ended up fixing it.
    – mxbi
    Apr 1 at 16:12














up vote
0
down vote

favorite












I'm trying to make a user systemd service that runs a python script - however, when I try starting the service with systemctl --user start shadesmath, and then do systemctl status shadesmath, I get:



● shadesmath.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)


Here is the contents of my shadesmath.service file, which has been placed in ~/.config/systemd/user/shadesmath.service with permissions 744:



[Unit]
Description=ShadesMath
AssertPathExists=/home/mikel/bots/mathbot/mathbot

[Service]
WorkingDirectory=/home/mikel/bots/mathbot/mathbot
ExecStart=/home/mikel/anaconda3/bin/python bot.py parameters.json
Restart=always

[Install]
WantedBy=default.target


I tried running systemctl --user enable shadesmath, which created a symlink to the service in ~/.config/user/systemd/default.target.wants, but this hasn't seemed to change anything when I try starting the service.



This is my first time trying to use systemd, so chances are I'm doing something stupid, but I can't figure out what the issue is. Any pointers on how to set this up would be much appreciated. My goal is to have a service that runs this python script, and to re-run it on startup/if the script finishes or crashes - ideally I want this to be a user service as I don't want this running as root.










share|improve this question





















  • The issue seems to have fixed itself with some more fiddling (redoing the steps in the question) but unfortunately I don't know what actually ended up fixing it.
    – mxbi
    Apr 1 at 16:12












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I'm trying to make a user systemd service that runs a python script - however, when I try starting the service with systemctl --user start shadesmath, and then do systemctl status shadesmath, I get:



● shadesmath.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)


Here is the contents of my shadesmath.service file, which has been placed in ~/.config/systemd/user/shadesmath.service with permissions 744:



[Unit]
Description=ShadesMath
AssertPathExists=/home/mikel/bots/mathbot/mathbot

[Service]
WorkingDirectory=/home/mikel/bots/mathbot/mathbot
ExecStart=/home/mikel/anaconda3/bin/python bot.py parameters.json
Restart=always

[Install]
WantedBy=default.target


I tried running systemctl --user enable shadesmath, which created a symlink to the service in ~/.config/user/systemd/default.target.wants, but this hasn't seemed to change anything when I try starting the service.



This is my first time trying to use systemd, so chances are I'm doing something stupid, but I can't figure out what the issue is. Any pointers on how to set this up would be much appreciated. My goal is to have a service that runs this python script, and to re-run it on startup/if the script finishes or crashes - ideally I want this to be a user service as I don't want this running as root.










share|improve this question













I'm trying to make a user systemd service that runs a python script - however, when I try starting the service with systemctl --user start shadesmath, and then do systemctl status shadesmath, I get:



● shadesmath.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)


Here is the contents of my shadesmath.service file, which has been placed in ~/.config/systemd/user/shadesmath.service with permissions 744:



[Unit]
Description=ShadesMath
AssertPathExists=/home/mikel/bots/mathbot/mathbot

[Service]
WorkingDirectory=/home/mikel/bots/mathbot/mathbot
ExecStart=/home/mikel/anaconda3/bin/python bot.py parameters.json
Restart=always

[Install]
WantedBy=default.target


I tried running systemctl --user enable shadesmath, which created a symlink to the service in ~/.config/user/systemd/default.target.wants, but this hasn't seemed to change anything when I try starting the service.



This is my first time trying to use systemd, so chances are I'm doing something stupid, but I can't figure out what the issue is. Any pointers on how to set this up would be much appreciated. My goal is to have a service that runs this python script, and to re-run it on startup/if the script finishes or crashes - ideally I want this to be a user service as I don't want this running as root.







16.04 services systemd






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Apr 1 at 12:26









mxbi

1434




1434











  • The issue seems to have fixed itself with some more fiddling (redoing the steps in the question) but unfortunately I don't know what actually ended up fixing it.
    – mxbi
    Apr 1 at 16:12
















  • The issue seems to have fixed itself with some more fiddling (redoing the steps in the question) but unfortunately I don't know what actually ended up fixing it.
    – mxbi
    Apr 1 at 16:12















The issue seems to have fixed itself with some more fiddling (redoing the steps in the question) but unfortunately I don't know what actually ended up fixing it.
– mxbi
Apr 1 at 16:12




The issue seems to have fixed itself with some more fiddling (redoing the steps in the question) but unfortunately I don't know what actually ended up fixing it.
– mxbi
Apr 1 at 16:12










1 Answer
1






active

oldest

votes

















up vote
1
down vote













I had the same problem; logging out and back in did not work but the answer was very simple: just reboot.






share|improve this answer






















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "89"
    ;
    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: true,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    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%2faskubuntu.com%2fquestions%2f1021043%2ftrying-to-setup-user-systemd-service-loaded-not-found-reason-no-such-file-or%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 had the same problem; logging out and back in did not work but the answer was very simple: just reboot.






    share|improve this answer


























      up vote
      1
      down vote













      I had the same problem; logging out and back in did not work but the answer was very simple: just reboot.






      share|improve this answer
























        up vote
        1
        down vote










        up vote
        1
        down vote









        I had the same problem; logging out and back in did not work but the answer was very simple: just reboot.






        share|improve this answer














        I had the same problem; logging out and back in did not work but the answer was very simple: just reboot.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited May 26 at 17:50









        Zanna

        48k13119228




        48k13119228










        answered May 26 at 17:45









        noraj

        19116




        19116



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1021043%2ftrying-to-setup-user-systemd-service-loaded-not-found-reason-no-such-file-or%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            Which professions warranted travel in Medieval times?

            How do so many people here on Academia.SE, and in general, afford lavish higher education programs?

            Trouble downloading packages list due to a “Hash sum mismatch” error