Systemd forking service starts and stops simultaneously on Ubuntu 18.04 - Minecraft server issues











up vote
0
down vote

favorite












I recently upgraded to 18.04.1 and am having trouble getting my Minecraft systemd service working again. I did a clean install of 18.04 from 16.04. This service was working properly on 16.04, but now it doesn't seem to work. When I run "systemctl start minecraft.service" it seems to run the ExecStart script and the ExecStop script together based on the status output below, but I do not see any output from the scripts in my tmux console that it should be running through. If I call the startup script manually, it works fine, so something is wrong in the systemd service.



The service is set to run as the minecraft user under minecraft group. Everything in /srv/minecraft is owned by minecraft user/group. The minecraft.service file is owned by root. All of this is the same as it was in 16.04 when it was working. Please let me know if you have any ideas to get it running again! Thanks!!



:/etc/systemd/system$ systemctl status minecraft.service
● minecraft.service - Minecraft Server
Loaded: loaded (/etc/systemd/system/minecraft.service; enabled; vendor
preset
Active: inactive (dead) since Wed 2018-11-14 16:33:25 PST; 3s ago
Process: 4667 ExecStop=/srv/minecraft/mc_server.sh stop (code=exited,
status=0/SUCCESS)
Process: 4651 ExecStart=/srv/minecraft/mc_server.sh start (code=exited,
status=0/SUCCESS)

Nov 14 16:33:11 systemd[1]: Starting Minecraft Server...
Nov 14 16:33:11 mc_server.sh[4651]: Session found. Connecting.
Nov 14 16:33:11 mc_server.sh[4651]: Minecraft server successfully
started
Nov 14 16:33:11 mc_server.sh[4667]: step 1 successs
Nov 14 16:33:19 mc_server.sh[4667]: step 2 success
Nov 14 16:33:21 mc_server.sh[4667]: server shutdown success
Nov 14 16:33:25 systemd[1]: Started Minecraft Server.


Here is the systemd script:



# Source: https://github.com/agowa338/MinecraftSystemdUnit/
# License: MIT
[Unit]
Description=Minecraft Server
After=network.target auditd.service

[Service]
WorkingDirectory=/srv/minecraft/
# PrivateUsers=true
User=minecraft
Group=minecraft
ProtectSystem=full
ProtectHome=true
# ProtectKernelTunables=true
# Implies MountFlags=slave
# ProtectKernelModules=true
# Implies NoNewPrivileges=yes
# ProtectControlGroups=true
# Implies MountAPIVFS=yes
Type=forking

ExecStart=/srv/minecraft/mc_server.sh start

ExecStop=/srv/minecraft/mc_server.sh stop

Restart=on-abnormal
RestartSec=60s

[Install]
WantedBy=multi-user.target

#########
# HowTo
#########
#
# Create a directory in /opt/minecraft/XX where XX is a name like 'survival'
# Add minecraft_server.jar into dir with other conf files for minecraft server
#
# Enable/Start systemd service
# systemctl enable minecraft@survival
# systemctl start minecraft@survival
#
# To run multiple servers simply create a new dir structure and enable/start it
# systemctl enable minecraft@creative









share|improve this question




























    up vote
    0
    down vote

    favorite












    I recently upgraded to 18.04.1 and am having trouble getting my Minecraft systemd service working again. I did a clean install of 18.04 from 16.04. This service was working properly on 16.04, but now it doesn't seem to work. When I run "systemctl start minecraft.service" it seems to run the ExecStart script and the ExecStop script together based on the status output below, but I do not see any output from the scripts in my tmux console that it should be running through. If I call the startup script manually, it works fine, so something is wrong in the systemd service.



    The service is set to run as the minecraft user under minecraft group. Everything in /srv/minecraft is owned by minecraft user/group. The minecraft.service file is owned by root. All of this is the same as it was in 16.04 when it was working. Please let me know if you have any ideas to get it running again! Thanks!!



    :/etc/systemd/system$ systemctl status minecraft.service
    ● minecraft.service - Minecraft Server
    Loaded: loaded (/etc/systemd/system/minecraft.service; enabled; vendor
    preset
    Active: inactive (dead) since Wed 2018-11-14 16:33:25 PST; 3s ago
    Process: 4667 ExecStop=/srv/minecraft/mc_server.sh stop (code=exited,
    status=0/SUCCESS)
    Process: 4651 ExecStart=/srv/minecraft/mc_server.sh start (code=exited,
    status=0/SUCCESS)

    Nov 14 16:33:11 systemd[1]: Starting Minecraft Server...
    Nov 14 16:33:11 mc_server.sh[4651]: Session found. Connecting.
    Nov 14 16:33:11 mc_server.sh[4651]: Minecraft server successfully
    started
    Nov 14 16:33:11 mc_server.sh[4667]: step 1 successs
    Nov 14 16:33:19 mc_server.sh[4667]: step 2 success
    Nov 14 16:33:21 mc_server.sh[4667]: server shutdown success
    Nov 14 16:33:25 systemd[1]: Started Minecraft Server.


    Here is the systemd script:



    # Source: https://github.com/agowa338/MinecraftSystemdUnit/
    # License: MIT
    [Unit]
    Description=Minecraft Server
    After=network.target auditd.service

    [Service]
    WorkingDirectory=/srv/minecraft/
    # PrivateUsers=true
    User=minecraft
    Group=minecraft
    ProtectSystem=full
    ProtectHome=true
    # ProtectKernelTunables=true
    # Implies MountFlags=slave
    # ProtectKernelModules=true
    # Implies NoNewPrivileges=yes
    # ProtectControlGroups=true
    # Implies MountAPIVFS=yes
    Type=forking

    ExecStart=/srv/minecraft/mc_server.sh start

    ExecStop=/srv/minecraft/mc_server.sh stop

    Restart=on-abnormal
    RestartSec=60s

    [Install]
    WantedBy=multi-user.target

    #########
    # HowTo
    #########
    #
    # Create a directory in /opt/minecraft/XX where XX is a name like 'survival'
    # Add minecraft_server.jar into dir with other conf files for minecraft server
    #
    # Enable/Start systemd service
    # systemctl enable minecraft@survival
    # systemctl start minecraft@survival
    #
    # To run multiple servers simply create a new dir structure and enable/start it
    # systemctl enable minecraft@creative









    share|improve this question


























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I recently upgraded to 18.04.1 and am having trouble getting my Minecraft systemd service working again. I did a clean install of 18.04 from 16.04. This service was working properly on 16.04, but now it doesn't seem to work. When I run "systemctl start minecraft.service" it seems to run the ExecStart script and the ExecStop script together based on the status output below, but I do not see any output from the scripts in my tmux console that it should be running through. If I call the startup script manually, it works fine, so something is wrong in the systemd service.



      The service is set to run as the minecraft user under minecraft group. Everything in /srv/minecraft is owned by minecraft user/group. The minecraft.service file is owned by root. All of this is the same as it was in 16.04 when it was working. Please let me know if you have any ideas to get it running again! Thanks!!



      :/etc/systemd/system$ systemctl status minecraft.service
      ● minecraft.service - Minecraft Server
      Loaded: loaded (/etc/systemd/system/minecraft.service; enabled; vendor
      preset
      Active: inactive (dead) since Wed 2018-11-14 16:33:25 PST; 3s ago
      Process: 4667 ExecStop=/srv/minecraft/mc_server.sh stop (code=exited,
      status=0/SUCCESS)
      Process: 4651 ExecStart=/srv/minecraft/mc_server.sh start (code=exited,
      status=0/SUCCESS)

      Nov 14 16:33:11 systemd[1]: Starting Minecraft Server...
      Nov 14 16:33:11 mc_server.sh[4651]: Session found. Connecting.
      Nov 14 16:33:11 mc_server.sh[4651]: Minecraft server successfully
      started
      Nov 14 16:33:11 mc_server.sh[4667]: step 1 successs
      Nov 14 16:33:19 mc_server.sh[4667]: step 2 success
      Nov 14 16:33:21 mc_server.sh[4667]: server shutdown success
      Nov 14 16:33:25 systemd[1]: Started Minecraft Server.


      Here is the systemd script:



      # Source: https://github.com/agowa338/MinecraftSystemdUnit/
      # License: MIT
      [Unit]
      Description=Minecraft Server
      After=network.target auditd.service

      [Service]
      WorkingDirectory=/srv/minecraft/
      # PrivateUsers=true
      User=minecraft
      Group=minecraft
      ProtectSystem=full
      ProtectHome=true
      # ProtectKernelTunables=true
      # Implies MountFlags=slave
      # ProtectKernelModules=true
      # Implies NoNewPrivileges=yes
      # ProtectControlGroups=true
      # Implies MountAPIVFS=yes
      Type=forking

      ExecStart=/srv/minecraft/mc_server.sh start

      ExecStop=/srv/minecraft/mc_server.sh stop

      Restart=on-abnormal
      RestartSec=60s

      [Install]
      WantedBy=multi-user.target

      #########
      # HowTo
      #########
      #
      # Create a directory in /opt/minecraft/XX where XX is a name like 'survival'
      # Add minecraft_server.jar into dir with other conf files for minecraft server
      #
      # Enable/Start systemd service
      # systemctl enable minecraft@survival
      # systemctl start minecraft@survival
      #
      # To run multiple servers simply create a new dir structure and enable/start it
      # systemctl enable minecraft@creative









      share|improve this question















      I recently upgraded to 18.04.1 and am having trouble getting my Minecraft systemd service working again. I did a clean install of 18.04 from 16.04. This service was working properly on 16.04, but now it doesn't seem to work. When I run "systemctl start minecraft.service" it seems to run the ExecStart script and the ExecStop script together based on the status output below, but I do not see any output from the scripts in my tmux console that it should be running through. If I call the startup script manually, it works fine, so something is wrong in the systemd service.



      The service is set to run as the minecraft user under minecraft group. Everything in /srv/minecraft is owned by minecraft user/group. The minecraft.service file is owned by root. All of this is the same as it was in 16.04 when it was working. Please let me know if you have any ideas to get it running again! Thanks!!



      :/etc/systemd/system$ systemctl status minecraft.service
      ● minecraft.service - Minecraft Server
      Loaded: loaded (/etc/systemd/system/minecraft.service; enabled; vendor
      preset
      Active: inactive (dead) since Wed 2018-11-14 16:33:25 PST; 3s ago
      Process: 4667 ExecStop=/srv/minecraft/mc_server.sh stop (code=exited,
      status=0/SUCCESS)
      Process: 4651 ExecStart=/srv/minecraft/mc_server.sh start (code=exited,
      status=0/SUCCESS)

      Nov 14 16:33:11 systemd[1]: Starting Minecraft Server...
      Nov 14 16:33:11 mc_server.sh[4651]: Session found. Connecting.
      Nov 14 16:33:11 mc_server.sh[4651]: Minecraft server successfully
      started
      Nov 14 16:33:11 mc_server.sh[4667]: step 1 successs
      Nov 14 16:33:19 mc_server.sh[4667]: step 2 success
      Nov 14 16:33:21 mc_server.sh[4667]: server shutdown success
      Nov 14 16:33:25 systemd[1]: Started Minecraft Server.


      Here is the systemd script:



      # Source: https://github.com/agowa338/MinecraftSystemdUnit/
      # License: MIT
      [Unit]
      Description=Minecraft Server
      After=network.target auditd.service

      [Service]
      WorkingDirectory=/srv/minecraft/
      # PrivateUsers=true
      User=minecraft
      Group=minecraft
      ProtectSystem=full
      ProtectHome=true
      # ProtectKernelTunables=true
      # Implies MountFlags=slave
      # ProtectKernelModules=true
      # Implies NoNewPrivileges=yes
      # ProtectControlGroups=true
      # Implies MountAPIVFS=yes
      Type=forking

      ExecStart=/srv/minecraft/mc_server.sh start

      ExecStop=/srv/minecraft/mc_server.sh stop

      Restart=on-abnormal
      RestartSec=60s

      [Install]
      WantedBy=multi-user.target

      #########
      # HowTo
      #########
      #
      # Create a directory in /opt/minecraft/XX where XX is a name like 'survival'
      # Add minecraft_server.jar into dir with other conf files for minecraft server
      #
      # Enable/Start systemd service
      # systemctl enable minecraft@survival
      # systemctl start minecraft@survival
      #
      # To run multiple servers simply create a new dir structure and enable/start it
      # systemctl enable minecraft@creative






      server 18.04 scripts systemd minecraft






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 2 hours ago

























      asked yesterday









      MysticEagle

      184




      184



























          active

          oldest

          votes











          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: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          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%2f1093040%2fsystemd-forking-service-starts-and-stops-simultaneously-on-ubuntu-18-04-minecr%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          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%2faskubuntu.com%2fquestions%2f1093040%2fsystemd-forking-service-starts-and-stops-simultaneously-on-ubuntu-18-04-minecr%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

          Mangá

           ⁒  ․,‪⁊‑⁙ ⁖, ⁇‒※‌, †,⁖‗‌⁝    ‾‸⁘,‖⁔⁣,⁂‾
”‑,‥–,‬ ,⁀‹⁋‴⁑ ‒ ,‴⁋”‼ ⁨,‷⁔„ ‰′,‐‚ ‥‡‎“‷⁃⁨⁅⁣,⁔
⁇‘⁔⁡⁏⁌⁡‿‶‏⁨ ⁣⁕⁖⁨⁩⁥‽⁀  ‴‬⁜‟ ⁃‣‧⁕‮ …‍⁨‴ ⁩,⁚⁖‫ ,‵ ⁀,‮⁝‣‣ ⁑  ⁂– ․, ‾‽ ‏⁁“⁗‸ ‾… ‹‡⁌⁎‸‘ ‡⁏⁌‪ ‵⁛ ‎⁨ ―⁦⁤⁄⁕