Is there a way to create a detached BYOBU session on system boot?












1















First off - Thank you Dustin for creating such an amazing wrapper to TMUX. I have used TMUX for years, but this really brings things to the next level.



OK, I am using BYOBU in order to monitor and maintain a bunch of screens related to cryptomining. It's working great so far



Here is a sample window file I am using



new -s mining -c /home/prospector/mining ./run.sh;
renamew -t0 dstm ;
splitw watch -n1 nvidia-smi ;
splitw -t0 tail -f /home/prospector/mining/logs/dstm.log ;


This works great. Now, I want to be able to spawn this at startup. I tried adding a detach keyword from tmux in this file and adding it to a systemd start script, but after a lot of messing around, I just can't figure how to get it to start up



Here is my latest attempt at the systemd script



[Unit]
Description=BYOBU Session with miner
After=network.target default.target

[Service]
Environment=BYOBU_WINDOWS=mining
Environment=HOME=/home/prospector
Environment=TERM=xterm-256color
ExecStart=/bin/bash -c '/usr/bin/byobu'
Type=oneshot
RemainAfterExit=yes
User=prospector
Group=prospector

[Install]
WantedBy=default.target


When this starts up though, I see




Unit miner.service has begun starting up.
Dec 21 09:58:41 prospector bash[1062]: open terminal failed: not a terminal
Dec 21 09:58:41 prospector systemd[1]: miner.service: Main process exited, code=exited, status=1/FAILURE
Dec 21 09:58:41 prospector systemd[1]: Failed to start BYOBU Session with miner.




My next attempt was to try to start a tmux server in detached mode and source my BYOBU file (this actually kind of works), but then when BYOBU starts up later and sees the session, it loads as regular tmux session...and doesn't add the nice BYOBU customization



Thanks to anyone that can assist!










share|improve this question



























    1















    First off - Thank you Dustin for creating such an amazing wrapper to TMUX. I have used TMUX for years, but this really brings things to the next level.



    OK, I am using BYOBU in order to monitor and maintain a bunch of screens related to cryptomining. It's working great so far



    Here is a sample window file I am using



    new -s mining -c /home/prospector/mining ./run.sh;
    renamew -t0 dstm ;
    splitw watch -n1 nvidia-smi ;
    splitw -t0 tail -f /home/prospector/mining/logs/dstm.log ;


    This works great. Now, I want to be able to spawn this at startup. I tried adding a detach keyword from tmux in this file and adding it to a systemd start script, but after a lot of messing around, I just can't figure how to get it to start up



    Here is my latest attempt at the systemd script



    [Unit]
    Description=BYOBU Session with miner
    After=network.target default.target

    [Service]
    Environment=BYOBU_WINDOWS=mining
    Environment=HOME=/home/prospector
    Environment=TERM=xterm-256color
    ExecStart=/bin/bash -c '/usr/bin/byobu'
    Type=oneshot
    RemainAfterExit=yes
    User=prospector
    Group=prospector

    [Install]
    WantedBy=default.target


    When this starts up though, I see




    Unit miner.service has begun starting up.
    Dec 21 09:58:41 prospector bash[1062]: open terminal failed: not a terminal
    Dec 21 09:58:41 prospector systemd[1]: miner.service: Main process exited, code=exited, status=1/FAILURE
    Dec 21 09:58:41 prospector systemd[1]: Failed to start BYOBU Session with miner.




    My next attempt was to try to start a tmux server in detached mode and source my BYOBU file (this actually kind of works), but then when BYOBU starts up later and sees the session, it loads as regular tmux session...and doesn't add the nice BYOBU customization



    Thanks to anyone that can assist!










    share|improve this question

























      1












      1








      1








      First off - Thank you Dustin for creating such an amazing wrapper to TMUX. I have used TMUX for years, but this really brings things to the next level.



      OK, I am using BYOBU in order to monitor and maintain a bunch of screens related to cryptomining. It's working great so far



      Here is a sample window file I am using



      new -s mining -c /home/prospector/mining ./run.sh;
      renamew -t0 dstm ;
      splitw watch -n1 nvidia-smi ;
      splitw -t0 tail -f /home/prospector/mining/logs/dstm.log ;


      This works great. Now, I want to be able to spawn this at startup. I tried adding a detach keyword from tmux in this file and adding it to a systemd start script, but after a lot of messing around, I just can't figure how to get it to start up



      Here is my latest attempt at the systemd script



      [Unit]
      Description=BYOBU Session with miner
      After=network.target default.target

      [Service]
      Environment=BYOBU_WINDOWS=mining
      Environment=HOME=/home/prospector
      Environment=TERM=xterm-256color
      ExecStart=/bin/bash -c '/usr/bin/byobu'
      Type=oneshot
      RemainAfterExit=yes
      User=prospector
      Group=prospector

      [Install]
      WantedBy=default.target


      When this starts up though, I see




      Unit miner.service has begun starting up.
      Dec 21 09:58:41 prospector bash[1062]: open terminal failed: not a terminal
      Dec 21 09:58:41 prospector systemd[1]: miner.service: Main process exited, code=exited, status=1/FAILURE
      Dec 21 09:58:41 prospector systemd[1]: Failed to start BYOBU Session with miner.




      My next attempt was to try to start a tmux server in detached mode and source my BYOBU file (this actually kind of works), but then when BYOBU starts up later and sees the session, it loads as regular tmux session...and doesn't add the nice BYOBU customization



      Thanks to anyone that can assist!










      share|improve this question














      First off - Thank you Dustin for creating such an amazing wrapper to TMUX. I have used TMUX for years, but this really brings things to the next level.



      OK, I am using BYOBU in order to monitor and maintain a bunch of screens related to cryptomining. It's working great so far



      Here is a sample window file I am using



      new -s mining -c /home/prospector/mining ./run.sh;
      renamew -t0 dstm ;
      splitw watch -n1 nvidia-smi ;
      splitw -t0 tail -f /home/prospector/mining/logs/dstm.log ;


      This works great. Now, I want to be able to spawn this at startup. I tried adding a detach keyword from tmux in this file and adding it to a systemd start script, but after a lot of messing around, I just can't figure how to get it to start up



      Here is my latest attempt at the systemd script



      [Unit]
      Description=BYOBU Session with miner
      After=network.target default.target

      [Service]
      Environment=BYOBU_WINDOWS=mining
      Environment=HOME=/home/prospector
      Environment=TERM=xterm-256color
      ExecStart=/bin/bash -c '/usr/bin/byobu'
      Type=oneshot
      RemainAfterExit=yes
      User=prospector
      Group=prospector

      [Install]
      WantedBy=default.target


      When this starts up though, I see




      Unit miner.service has begun starting up.
      Dec 21 09:58:41 prospector bash[1062]: open terminal failed: not a terminal
      Dec 21 09:58:41 prospector systemd[1]: miner.service: Main process exited, code=exited, status=1/FAILURE
      Dec 21 09:58:41 prospector systemd[1]: Failed to start BYOBU Session with miner.




      My next attempt was to try to start a tmux server in detached mode and source my BYOBU file (this actually kind of works), but then when BYOBU starts up later and sees the session, it loads as regular tmux session...and doesn't add the nice BYOBU customization



      Thanks to anyone that can assist!







      boot screen systemd byobu tmux






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 21 '17 at 15:14









      adawalliadawalli

      61




      61






















          1 Answer
          1






          active

          oldest

          votes


















          0














          You can issue commands to Byobu's backend (tmux or screen) when launching it.



          Using screen



          byobu-screen -d -m ping google.com


          Using tmux



          byobu-tmux new-session -d -m ping google.com
          # If tmux is default backend
          byobu new-session -d -m ping google.com





          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',
            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%2faskubuntu.com%2fquestions%2f988377%2fis-there-a-way-to-create-a-detached-byobu-session-on-system-boot%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            You can issue commands to Byobu's backend (tmux or screen) when launching it.



            Using screen



            byobu-screen -d -m ping google.com


            Using tmux



            byobu-tmux new-session -d -m ping google.com
            # If tmux is default backend
            byobu new-session -d -m ping google.com





            share|improve this answer




























              0














              You can issue commands to Byobu's backend (tmux or screen) when launching it.



              Using screen



              byobu-screen -d -m ping google.com


              Using tmux



              byobu-tmux new-session -d -m ping google.com
              # If tmux is default backend
              byobu new-session -d -m ping google.com





              share|improve this answer


























                0












                0








                0







                You can issue commands to Byobu's backend (tmux or screen) when launching it.



                Using screen



                byobu-screen -d -m ping google.com


                Using tmux



                byobu-tmux new-session -d -m ping google.com
                # If tmux is default backend
                byobu new-session -d -m ping google.com





                share|improve this answer













                You can issue commands to Byobu's backend (tmux or screen) when launching it.



                Using screen



                byobu-screen -d -m ping google.com


                Using tmux



                byobu-tmux new-session -d -m ping google.com
                # If tmux is default backend
                byobu new-session -d -m ping google.com






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Feb 13 at 19:39









                KarolisLKarolisL

                11




                11






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Ask Ubuntu!


                    • 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%2faskubuntu.com%2fquestions%2f988377%2fis-there-a-way-to-create-a-detached-byobu-session-on-system-boot%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á

                    Eduardo VII do Reino Unido