0

My make serve command runs my jupyter-book fine with make serve

codio@anita-doctor:~/workspace/Introduction-to-Data-Science/IntroBook$ make serve
bundle exec guard
Configuration file: _config.yml
15:21:53 - INFO - Jekyll building...
15:21:54 - INFO - Jekyll build completed in 0.75s /home/codio/workspace/Introduction-to-Data- 
Science/IntroBook → _site
15:21:54 - INFO - Jekyll watching and serving using jekyll at 0.0.0.0:4000/jupyter-book
15:21:54 - INFO - Jekyll watching
15:21:54 - INFO - LiveReload is waiting for a browser to connect.
15:21:54 - INFO - Guard is now watching at '/home/codio/workspace/Introduction-to-Data- 
Science/IntroBook'
Server address: http://0.0.0.0:4000/jupyter-book/
Server running... press ctrl-c to stop.
/home/codio/anaconda/lib/ruby/gems/2.6.0/gems/guard-2.14.2/lib/guard/jobs/pry_wrapper.rb:279: 
warning: method Pry#input_array is deprecated. Use Pry#inp
ut_ring instead
[1] guard(main)>

So I tried using this nohup command to run it in the background

 codio@anita-doctor:~/workspace/Introduction-to-Data-Science/IntroBook$ nohup make serve >/dev/null 
 2>&1 &
 [2] 2135
 [1]   Done               nohup make serve < /dev/null > /dev/null 2>&1

This command or type of commands usually does nothing. I believe I may be close. But, the nohup commands do not seem to allow the ruby 'make serve' command to work. My goal is to host the server, as I did in the first line of code with the make serve command from my ubuntu box, in the background. Any help would be appreciated.

1 Answers1

0

I've found that nohup can be a bit problematic. It is better to either set your server up as a service (like mysqld, sshd, etc.) or to use "at" to kick it off. If the command works when you run it in the foreground (without nohup) then running it with "at" will work since it applies the current environment to the command and has "atd" as a parent process that won't go away when you log off (which sometimes breaks nohup when it tries to re-assign the parent process):

at now
at> make serve >>/var/log/rubyserver.log 2>&1
at> ^D