Skip to content

Using RStudio addins will kill the hugo server in the background #721

@yihui

Description

@yihui

I upgraded RStudio from 2022.02.3,492 to 2022.07.1,554 yesterday and found that the hugo server launched by blogdown::serve_site() would almost always be killed after I close any RStudio addin (e.g., the "New Post" addin of blogdown). That is, as soon as I close the addin, the website preview is dead. This only happens with options(blogdown.use.processx = FALSE) (i.e., the background process is launched via system2(wait = FALSE)).

I spent a couple of hours on trying to figure out why this happens but didn't find out the culprit. I thought it was because of the new RStudio version, but even if I go back to the older version, the same thing occurs. Other findings:

  1. It's not limited to RStudio addins, but any Shiny apps. If I run and stop any Shiny app, the hugo server is stopped, too.
  2. I tested several Hugo versions and only 0.25/0.26 survived. I also tested other background processes (e.g., a shell script with an infinite loop), and they wouldn't be killed.
  3. options(blogdown.use.processx = TRUE) works fine (the process won't be killed).

I'm not sure if this is specific to macOS. @cderv Are you able to reproduce it on Windows/Linux?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions