Start tmux and execute a set of commands on boot The 2019 Stack Overflow Developer Survey...

What is the closest word meaning "respect for time / mindful"

One word riddle: Vowel in the middle

Is flight data recorder erased after every flight?

How to notate time signature switching consistently every measure

Multiply Two Integer Polynomials

Are spiders unable to hurt humans, especially very small spiders?

What do the Banks children have against barley water?

Why not take a picture of a closer black hole?

How to support a colleague who finds meetings extremely tiring?

Does a dangling wire really electrocute me if I'm standing in water?

Button changing it's text & action. Good or terrible?

Is an up-to-date browser secure on an out-of-date OS?

How technical should a Scrum Master be to effectively remove impediments?

Are there any other methods to apply to solving simultaneous equations?

Protecting Dualbooting Windows from dangerous code (like rm -rf)

Right tool to dig six foot holes?

Why can Shazam fly?

Looking for Correct Greek Translation for Heraclitus

How come people say “Would of”?

Can one be advised by a professor who is very far away?

FPGA - DIY Programming

If a Druid sees an animal’s corpse, can they Wild Shape into that animal?

What could be the right powersource for 15 seconds lifespan disposable giant chainsaw?

Why was M87 targetted for the Event Horizon Telescope instead of Sagittarius A*?



Start tmux and execute a set of commands on boot



The 2019 Stack Overflow Developer Survey Results Are Intmux session lost in unknown pts, cause and possible solution?tmux: Set default session for attachtmux, Vim and SolarizedPython script: wait until job in tmux session has completedneed a detailed guide to start scripts and applications in xfce4Cannot trigger tmux script on bootStart Tmux with specific applications on each pane?Bash script to start tmux and issue commandsIs there any web panel available out there that can start and stop a custom script/command I use to start/stop/update processes?tmux: Send and execute highlighted code in other pane





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















I'm trying to find a way to have tmux start for a specific user on boot. The tmux session should run two Python scripts.



I think I could start Python as mentioned here, but I'd rather have it in a tmux session.



Is that possible and how could I accomplish that?










share|improve this question


















  • 1





    Most cron implementations has a @reboot tag to run jobs on boot.

    – Kusalananda
    May 13 '18 at 16:05


















0















I'm trying to find a way to have tmux start for a specific user on boot. The tmux session should run two Python scripts.



I think I could start Python as mentioned here, but I'd rather have it in a tmux session.



Is that possible and how could I accomplish that?










share|improve this question


















  • 1





    Most cron implementations has a @reboot tag to run jobs on boot.

    – Kusalananda
    May 13 '18 at 16:05














0












0








0








I'm trying to find a way to have tmux start for a specific user on boot. The tmux session should run two Python scripts.



I think I could start Python as mentioned here, but I'd rather have it in a tmux session.



Is that possible and how could I accomplish that?










share|improve this question














I'm trying to find a way to have tmux start for a specific user on boot. The tmux session should run two Python scripts.



I think I could start Python as mentioned here, but I'd rather have it in a tmux session.



Is that possible and how could I accomplish that?







boot python tmux startup autostart






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked May 13 '18 at 15:51









boolean.is.nullboolean.is.null

194314




194314








  • 1





    Most cron implementations has a @reboot tag to run jobs on boot.

    – Kusalananda
    May 13 '18 at 16:05














  • 1





    Most cron implementations has a @reboot tag to run jobs on boot.

    – Kusalananda
    May 13 '18 at 16:05








1




1





Most cron implementations has a @reboot tag to run jobs on boot.

– Kusalananda
May 13 '18 at 16:05





Most cron implementations has a @reboot tag to run jobs on boot.

– Kusalananda
May 13 '18 at 16:05










2 Answers
2






active

oldest

votes


















0














In my case, I have a user account just for the purpose of running one single script, so I provide a default tmux configuration in that user's home directory by creating a file ~/.tmux.conf



My ~/.tmux.conf file looks (roughly) like this:



new-session -d -s MYSESSIONNAME
set -g status off
new-window ~/my-startup-script.sh


my-startup-script.sh needs to have the +x permission set, obviously.



To start the ~/.tmux.conf tmux script, issue the command



tmux start-server





share|improve this answer































    0














    On a system where cron @reboot runs too early in the boot sequence, I run a shell script of the pattern



    #!/bin/bash
    source ~/.bash_profile
    if tmux has-session -t auto-session > /dev/null 2>&1; then
    :
    else
    tmux new-session -d -s auto-session -n foo bar
    tmux new-window -d -t auto-session
    fi


    regularly every few minutes via crontab



    */2 * * * * $HOME/path/to/start-user-auto-session.bash





    share|improve this answer








    New contributor




    ndim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "106"
      };
      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: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      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%2funix.stackexchange.com%2fquestions%2f443569%2fstart-tmux-and-execute-a-set-of-commands-on-boot%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














      In my case, I have a user account just for the purpose of running one single script, so I provide a default tmux configuration in that user's home directory by creating a file ~/.tmux.conf



      My ~/.tmux.conf file looks (roughly) like this:



      new-session -d -s MYSESSIONNAME
      set -g status off
      new-window ~/my-startup-script.sh


      my-startup-script.sh needs to have the +x permission set, obviously.



      To start the ~/.tmux.conf tmux script, issue the command



      tmux start-server





      share|improve this answer




























        0














        In my case, I have a user account just for the purpose of running one single script, so I provide a default tmux configuration in that user's home directory by creating a file ~/.tmux.conf



        My ~/.tmux.conf file looks (roughly) like this:



        new-session -d -s MYSESSIONNAME
        set -g status off
        new-window ~/my-startup-script.sh


        my-startup-script.sh needs to have the +x permission set, obviously.



        To start the ~/.tmux.conf tmux script, issue the command



        tmux start-server





        share|improve this answer


























          0












          0








          0







          In my case, I have a user account just for the purpose of running one single script, so I provide a default tmux configuration in that user's home directory by creating a file ~/.tmux.conf



          My ~/.tmux.conf file looks (roughly) like this:



          new-session -d -s MYSESSIONNAME
          set -g status off
          new-window ~/my-startup-script.sh


          my-startup-script.sh needs to have the +x permission set, obviously.



          To start the ~/.tmux.conf tmux script, issue the command



          tmux start-server





          share|improve this answer













          In my case, I have a user account just for the purpose of running one single script, so I provide a default tmux configuration in that user's home directory by creating a file ~/.tmux.conf



          My ~/.tmux.conf file looks (roughly) like this:



          new-session -d -s MYSESSIONNAME
          set -g status off
          new-window ~/my-startup-script.sh


          my-startup-script.sh needs to have the +x permission set, obviously.



          To start the ~/.tmux.conf tmux script, issue the command



          tmux start-server






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Sep 4 '18 at 12:04









          KlawsKlaws

          1011




          1011

























              0














              On a system where cron @reboot runs too early in the boot sequence, I run a shell script of the pattern



              #!/bin/bash
              source ~/.bash_profile
              if tmux has-session -t auto-session > /dev/null 2>&1; then
              :
              else
              tmux new-session -d -s auto-session -n foo bar
              tmux new-window -d -t auto-session
              fi


              regularly every few minutes via crontab



              */2 * * * * $HOME/path/to/start-user-auto-session.bash





              share|improve this answer








              New contributor




              ndim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.

























                0














                On a system where cron @reboot runs too early in the boot sequence, I run a shell script of the pattern



                #!/bin/bash
                source ~/.bash_profile
                if tmux has-session -t auto-session > /dev/null 2>&1; then
                :
                else
                tmux new-session -d -s auto-session -n foo bar
                tmux new-window -d -t auto-session
                fi


                regularly every few minutes via crontab



                */2 * * * * $HOME/path/to/start-user-auto-session.bash





                share|improve this answer








                New contributor




                ndim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.























                  0












                  0








                  0







                  On a system where cron @reboot runs too early in the boot sequence, I run a shell script of the pattern



                  #!/bin/bash
                  source ~/.bash_profile
                  if tmux has-session -t auto-session > /dev/null 2>&1; then
                  :
                  else
                  tmux new-session -d -s auto-session -n foo bar
                  tmux new-window -d -t auto-session
                  fi


                  regularly every few minutes via crontab



                  */2 * * * * $HOME/path/to/start-user-auto-session.bash





                  share|improve this answer








                  New contributor




                  ndim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.










                  On a system where cron @reboot runs too early in the boot sequence, I run a shell script of the pattern



                  #!/bin/bash
                  source ~/.bash_profile
                  if tmux has-session -t auto-session > /dev/null 2>&1; then
                  :
                  else
                  tmux new-session -d -s auto-session -n foo bar
                  tmux new-window -d -t auto-session
                  fi


                  regularly every few minutes via crontab



                  */2 * * * * $HOME/path/to/start-user-auto-session.bash






                  share|improve this answer








                  New contributor




                  ndim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  share|improve this answer



                  share|improve this answer






                  New contributor




                  ndim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  answered 22 hours ago









                  ndimndim

                  1011




                  1011




                  New contributor




                  ndim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.





                  New contributor





                  ndim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






                  ndim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Unix & Linux Stack Exchange!


                      • 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%2funix.stackexchange.com%2fquestions%2f443569%2fstart-tmux-and-execute-a-set-of-commands-on-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

                      Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

                      Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

                      Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...