Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Lee Adams 6 posts 96 karma points
    Oct 02, 2023 @ 21:35
    Lee  Adams
    0

    What is the restart command for Umbraco in Linux?

    Hello folks,

    I'm just getting started with Umbraco. I have an Ubuntu host running Umbraco 12.1.2 in a docker with .NET 7. I'm learning how to setup a website framework and Umbraco sometimes starts throwing .NET errors and I have been bouncing the host to resolve them which is quite inefficient. What is the Linux command to stop and restart my Umbraco instance?

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Oct 03, 2023 @ 10:32
    Sebastiaan Janssen
    0

    That depends very much on your hosting provider, usually they have some kind of dashboard to do these things. If you have ssh access then your site is probably installed as a service, your hosting provider can tell you more on how to restart this service.

  • Lee Adams 6 posts 96 karma points
    Oct 03, 2023 @ 14:22
    Lee  Adams
    0

    My hosting provider is VMWare. I stood up an Ubuntu server 22.04 and installed the docker container on it. Yes, I have SSH into my machine. No, I didn't install a desktop.

  • Lee Adams 6 posts 96 karma points
    Oct 03, 2023 @ 14:23
    Lee  Adams
    0

    To be clear, we are running VMWare in my company's own datacenter.

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Oct 04, 2023 @ 08:57
    Sebastiaan Janssen
    1

    Alright.. well, whomever installed the site to run on that server should probably also know how to restart it 😅

    I am getting a feeling that it's you who set it up? Go back over the commands you followed and find the one where you start the site, typically that is done as a service, so you would probably do something like sudo systemctl restart MySite. But I think there's a few ways to set it up, so I am not sure what you did.

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Oct 04, 2023 @ 09:00
    Sebastiaan Janssen
    1

    FYI: this is how I personally have done it, ignore that it's a Raspberry Pi, it just runs Ubuntu server. https://cultiv.nl/blog/how-i-run-this-very-website-on-a-raspberry-pi-in-my-closet-at-home/

    This is purely for me to experiment with and I will be googling loads and loads when something goes wrong because I have very little real experience with Linux.

    FWIW I would not recommend running production sites on your own VM unless you know what you're doing. There's plenty of great hosting providers that can run your site and also give you a nice dashboard to help with things like restarting sites, rebooting servers, looking into logs etc.

  • Lee Adams 6 posts 96 karma points
    Oct 04, 2023 @ 17:35
    Lee  Adams
    100

    Hey Sebastiaan,

    I want to thank you for your suggestions. Yes, I was the one who installed and configured Ubuntu and installed Umbraco. My company has numerous datacenters around the world and we host our own content. We will not be using a third party to host the websites. I have found that, as long as I use the word 'Umbraco' in the name of my project, I can run:

    ps -ef | grep Umbraco
    

    This shows me four separate daemons running my Umbraco site. I can then run:

    sudo kill $(ps -ef | grep Umbraco | awk '{print $2}')
    

    To stop the site. I was really hoping there would be a Umbraco native command to just restart(HUP) the site but if there is, I cannot find it.

    As we all know, you should never keep a dog and bark for yourself so, here's a much easier command to stop the site:

    sudo pkill Umbraco
    

    Now, might anyone know of a command that will allow me to get the site running and then return me to the command line? right now if I run:

    sudo dotnet run --project /home/webuser/MyFirstUmbraco
    

    It will hang the session to run Umbraco.

    Building...
    

    I need to get my bash session back after Umbraco starts. Any suggestions would be greatly appreciated.

  • Lee Adams 6 posts 96 karma points
    Oct 04, 2023 @ 18:30
    Lee  Adams
    0

    Hey Sebastiaan,

    I have read your blog that talks about running Umbraco as a system service. I have followed your instructions but ran into an issue. A line in your MyProject.service file shows this path:

    /home/sebastiaan/testlive/MyProject.dll
    

    The only equivalent path I can find in my instance is:

    /home/webuser/MyFirstUmbraco/bin/Debug/net7.0/MyFirstUmbraco
    

    Running the full command path:

    /usr/bin/dotnet /home/sguser/MyFirstUmbraco/bin/Debug/net7.0/MyFirstUmbraco
    

    Does not start my site but simply errors out. The command I use to start my site is:

    sudo dotnet run --project /home/webuser/MyFirstUmbraco
    

    I placed that command in my crontab to start when the vm starts. I prefer to run Umbraco as a system service. What would be the correct line for me to use in MyFirstUmbraco.service?

Please Sign in or register to post replies

Write your reply to:

Draft