rstudio / shiny-server

Host Shiny applications over the web.
https://rstudio.com/shiny/server
Other
712 stars 290 forks source link

error message from grep during deb postinst.in #388

Open nbbn opened 5 years ago

nbbn commented 5 years ago

Hi, I noticed during installation inside docker image error: grep: /etc/init/shiny-server.conf: no such file or directory

I guess it's output of:

else
   cp ${CMAKE_INSTALL_PREFIX}/shiny-server/config/init.d/debian/shiny-server /etc/init.d/

   if ! grep -e "^export LANG=" /etc/init/shiny-server.conf > /dev/null; then
      echo "Adding LANG to /etc/init.d/shiny-server, setting to $SS_LANG"
      sed -i "10 a export LANG='$SS_LANG'" /etc/init.d/shiny-server
fi

from https://github.com/rstudio/shiny-server/blob/master/packaging/debian-control/postinst.in INIT_SYSTEM is equal to entrypoint script, in my case init.sh. I don't want to challenge logic of the conditional, but I think it can be made in more expressive way, that will not show this error message.

therealnlee commented 4 years ago

Hi did you fix this issue? I'm trying to intsall shiny server in ubuntu 18.04, and had encountered the same issue

shacharEtt commented 3 years ago

Hello, I have the same problem as @therealnlee with ubuntu 18.04.

When I use sudo gdebi shiny-server-1.5.15.953-amd64.deb I get: grep: /etc/init/shiny-server.conf: no such file or directory

and the following commands from the installation guide don't work. I checked and shiny-server.conf is at dir 'init.d'. Should i just change the dir name?

philipkimani commented 2 years ago

Am experiencing the same challenge when installing shiny server in Ubuntu ver 20 WSL2.

CallumHollywood commented 2 years ago

I am also running into the issue while trying to install shiny server on WSL2 + Ubuntu 20.04 on Windows 11. Shiny server won't install.

Anyone know of a solution yet?

leonhardt913 commented 10 months ago

I am experiencing same issue when installing shiny-server in ubuntu 22.04 on WSL2.

$ sudo gdebi shiny-server-1.5.20.1002-amd64.deb
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Reading state information... Done

Shiny Server
 Shiny Server is a server program from RStudio, Inc. that makes Shiny applications available over the web. Shiny is a web application framework for the R statistical computation language.
Do you want to install the software package? [y/N]:y
/usr/bin/gdebi:113: FutureWarning: Possible nested set at position 1
  c = findall("[[(](\S+)/\S+[])]", msg)[0].lower()
Selecting previously unselected package shiny-server.
(Reading database ... 49268 files and directories currently installed.)
Preparing to unpack shiny-server-1.5.20.1002-amd64.deb ...
Unpacking shiny-server (1.5.20.1002) ...
Setting up shiny-server (1.5.20.1002) ...
User shiny already exists. Ensuring proper permissions on /home/shiny/.
grep: /etc/init/shiny-server.conf: No such file or directory
Adding LANG to /etc/init.d/shiny-server, setting to C.UTF-8

I don't think the installation was success, anyone know how to solve it?

leonhardt913 commented 10 months ago

I tried mkdir /etc/init/ folder and re-installed it, and another trouble showed up:

/var/lib/dpkg/info/shiny-server.postinst: 97: initctl: not found
/var/lib/dpkg/info/shiny-server.postinst: 99: initctl: not found
qizhiyule commented 3 months ago

Yeah, I also encounter the issue when I try to install shiny-server in docker container of ubuntu 20.04 LTS. After a lot of trying, I got the right solution to this issue! As a contrast, I create a ubuntu 20.04 LTS virtual machine on workstation. Through the same installation way from official website, I start the shiny-server successfully in virtual machine. Then, I compare the installation directory and config files of shiny-server in virtual machine and in docker container. In fact, I find that the error message grep: /etc/init/shiny-server.conf: no such file or directory is nonsense and misleading. The file '/etc/init/shiny-server.conf' is absolutely unnecessary. The installation is success in deed. What is only missing is the file '/etc/systemd/system/shiny-server.service' that lead to shiny-server service can't launch normally. The right solution is to create a file vim /etc/systemd/system/shiny-server.service and copy this content into it:

[Unit]
Description=ShinyServer

[Service]
Type=simple
ExecStart=/usr/bin/env bash -c 'exec /opt/shiny-server/bin/shiny-server >> /var/log/shiny-server.log 2>&1'
KillMode=process
ExecReload=/usr/bin/env kill -HUP $MAINPID
ExecStopPost=/usr/bin/env sleep 5
Restart=on-failure
RestartSec=1
Environment="LANG=C.UTF-8"
StartLimitInterval=45
StartLimitBurst=3

[Install]
WantedBy=multi-user.target

Then, start the shiny-server service and you will find that port 3838 is running. Everything is good now.