IMHO the app should just start and manage its own jupyter server; Launch it on startup and shut it down when the app is closed. The notebook server doesn't fork into the background so its trivial to just keep a single process, no need for a pidfile.
If the user wants to launch a separate server (maybe with different options) by hand then he/she should be allowed to. PS: * Always use subprocess over os.system * Jupyter will autoincrement the port if it is in use, don't rely on it using the given --port * Race conditions with ports, pids, and filenames are unlikely but often exploitable security issues. On Sunday, January 17, 2016 at 5:53:07 AM UTC+1, Ivan Andrus wrote: > > To adapt to the soon-to-be-default Jupyter notebook in Sage, I’m updating > the Mac app to launch either SageNB or Jupyter depending on a preference. > Unfortunately, I can’t figure out how to determine if Jupyter is already > running at all, let alone in a given directory or on what port. I can > scrape the log if I’m the one who started the server, but I would like to > check if they have started it some other way. Does anyone know how to do > that? > > Also, I’m thinking of making ~/Documents/Sage the default directory to run > Jupyter in. Does that seem reasonable to everyone? > > -Ivan -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
