Can't start tmux with systemd












0















(Previously: Systemd unit file only works for one instance name, not the other)



After finding a solution for the question linked above, my Minecraft server did what it was supposed to. But today, while creating a manual backup (by stopping the server, copying its directory somewhere else, and restarting it), something broke, and I don't know what.



This is my systemd unit file as of now:



[Unit]
Description=Minecraft Server: %i
Requires=network.target local-fs.target
After=network.target local-fs.target

[Service]
WorkingDirectory=/opt/minecraft/servers/%i
User=minecraft
Group=minecraft
Type=forking
RemainAfterExit=yes

EnvironmentFile=/opt/minecraft/servers/%i/ENV

ExecStart=/usr/bin/tmux new -s %i -d '/usr/bin/java -Xms1G -Xmx${MEMORY_ALLOC} -Dminecraft.instancename=%i -jar forge-universal.jar nogui'

ExecStop=/usr/bin/tmux send -t %i 'say SERVER WILL SHUT DOWN IN 10 SECONDS' ENTER
ExecStop=/bin/sleep 10
ExecStop=/usr/bin/tmux send -t %i 'stop' ENTER

[Install]
WantedBy=multi-user.target


(The environment file referenced in the unit file just contains the line MEMORY_ALLOC=3G.)



systemctl start minecraft@creative instantly returns and does literally nothing. Executing tmux ls as user minecraft yields the unhelpful message no server running on /tmp/tmux-999/default.



The server can be run manually, either inside or outside of a tmux session using java -Xms1G -Xmx3G -jar forge-universal.jar nogui with no problems. It only does this when run in tmux via systemd.



systemctl --failed displays this:



0 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.


The journal contains no information whatsoever, as does the syslog.



I have no idea what's going on. Thanks to the internet outrage over the tmux-systemd thing from 2016, my Google results are largely unhelpful drivel. Does someone here know what I'm doing wrong?










share|improve this question





























    0















    (Previously: Systemd unit file only works for one instance name, not the other)



    After finding a solution for the question linked above, my Minecraft server did what it was supposed to. But today, while creating a manual backup (by stopping the server, copying its directory somewhere else, and restarting it), something broke, and I don't know what.



    This is my systemd unit file as of now:



    [Unit]
    Description=Minecraft Server: %i
    Requires=network.target local-fs.target
    After=network.target local-fs.target

    [Service]
    WorkingDirectory=/opt/minecraft/servers/%i
    User=minecraft
    Group=minecraft
    Type=forking
    RemainAfterExit=yes

    EnvironmentFile=/opt/minecraft/servers/%i/ENV

    ExecStart=/usr/bin/tmux new -s %i -d '/usr/bin/java -Xms1G -Xmx${MEMORY_ALLOC} -Dminecraft.instancename=%i -jar forge-universal.jar nogui'

    ExecStop=/usr/bin/tmux send -t %i 'say SERVER WILL SHUT DOWN IN 10 SECONDS' ENTER
    ExecStop=/bin/sleep 10
    ExecStop=/usr/bin/tmux send -t %i 'stop' ENTER

    [Install]
    WantedBy=multi-user.target


    (The environment file referenced in the unit file just contains the line MEMORY_ALLOC=3G.)



    systemctl start minecraft@creative instantly returns and does literally nothing. Executing tmux ls as user minecraft yields the unhelpful message no server running on /tmp/tmux-999/default.



    The server can be run manually, either inside or outside of a tmux session using java -Xms1G -Xmx3G -jar forge-universal.jar nogui with no problems. It only does this when run in tmux via systemd.



    systemctl --failed displays this:



    0 loaded units listed. Pass --all to see loaded but inactive units, too.
    To show all installed unit files use 'systemctl list-unit-files'.


    The journal contains no information whatsoever, as does the syslog.



    I have no idea what's going on. Thanks to the internet outrage over the tmux-systemd thing from 2016, my Google results are largely unhelpful drivel. Does someone here know what I'm doing wrong?










    share|improve this question



























      0












      0








      0








      (Previously: Systemd unit file only works for one instance name, not the other)



      After finding a solution for the question linked above, my Minecraft server did what it was supposed to. But today, while creating a manual backup (by stopping the server, copying its directory somewhere else, and restarting it), something broke, and I don't know what.



      This is my systemd unit file as of now:



      [Unit]
      Description=Minecraft Server: %i
      Requires=network.target local-fs.target
      After=network.target local-fs.target

      [Service]
      WorkingDirectory=/opt/minecraft/servers/%i
      User=minecraft
      Group=minecraft
      Type=forking
      RemainAfterExit=yes

      EnvironmentFile=/opt/minecraft/servers/%i/ENV

      ExecStart=/usr/bin/tmux new -s %i -d '/usr/bin/java -Xms1G -Xmx${MEMORY_ALLOC} -Dminecraft.instancename=%i -jar forge-universal.jar nogui'

      ExecStop=/usr/bin/tmux send -t %i 'say SERVER WILL SHUT DOWN IN 10 SECONDS' ENTER
      ExecStop=/bin/sleep 10
      ExecStop=/usr/bin/tmux send -t %i 'stop' ENTER

      [Install]
      WantedBy=multi-user.target


      (The environment file referenced in the unit file just contains the line MEMORY_ALLOC=3G.)



      systemctl start minecraft@creative instantly returns and does literally nothing. Executing tmux ls as user minecraft yields the unhelpful message no server running on /tmp/tmux-999/default.



      The server can be run manually, either inside or outside of a tmux session using java -Xms1G -Xmx3G -jar forge-universal.jar nogui with no problems. It only does this when run in tmux via systemd.



      systemctl --failed displays this:



      0 loaded units listed. Pass --all to see loaded but inactive units, too.
      To show all installed unit files use 'systemctl list-unit-files'.


      The journal contains no information whatsoever, as does the syslog.



      I have no idea what's going on. Thanks to the internet outrage over the tmux-systemd thing from 2016, my Google results are largely unhelpful drivel. Does someone here know what I'm doing wrong?










      share|improve this question
















      (Previously: Systemd unit file only works for one instance name, not the other)



      After finding a solution for the question linked above, my Minecraft server did what it was supposed to. But today, while creating a manual backup (by stopping the server, copying its directory somewhere else, and restarting it), something broke, and I don't know what.



      This is my systemd unit file as of now:



      [Unit]
      Description=Minecraft Server: %i
      Requires=network.target local-fs.target
      After=network.target local-fs.target

      [Service]
      WorkingDirectory=/opt/minecraft/servers/%i
      User=minecraft
      Group=minecraft
      Type=forking
      RemainAfterExit=yes

      EnvironmentFile=/opt/minecraft/servers/%i/ENV

      ExecStart=/usr/bin/tmux new -s %i -d '/usr/bin/java -Xms1G -Xmx${MEMORY_ALLOC} -Dminecraft.instancename=%i -jar forge-universal.jar nogui'

      ExecStop=/usr/bin/tmux send -t %i 'say SERVER WILL SHUT DOWN IN 10 SECONDS' ENTER
      ExecStop=/bin/sleep 10
      ExecStop=/usr/bin/tmux send -t %i 'stop' ENTER

      [Install]
      WantedBy=multi-user.target


      (The environment file referenced in the unit file just contains the line MEMORY_ALLOC=3G.)



      systemctl start minecraft@creative instantly returns and does literally nothing. Executing tmux ls as user minecraft yields the unhelpful message no server running on /tmp/tmux-999/default.



      The server can be run manually, either inside or outside of a tmux session using java -Xms1G -Xmx3G -jar forge-universal.jar nogui with no problems. It only does this when run in tmux via systemd.



      systemctl --failed displays this:



      0 loaded units listed. Pass --all to see loaded but inactive units, too.
      To show all installed unit files use 'systemctl list-unit-files'.


      The journal contains no information whatsoever, as does the syslog.



      I have no idea what's going on. Thanks to the internet outrage over the tmux-systemd thing from 2016, my Google results are largely unhelpful drivel. Does someone here know what I'm doing wrong?







      debian tmux systemd minecraft systemctl






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 31 at 18:07







      Peter W.

















      asked Jan 31 at 17:57









      Peter W.Peter W.

      4922620




      4922620






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          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',
          autoActivateHeartbeat: false,
          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%2fsuperuser.com%2fquestions%2f1400687%2fcant-start-tmux-with-systemd%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Super User!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1400687%2fcant-start-tmux-with-systemd%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á

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