Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screen returns "Cannot make directory '/run/screen': Permission denied" after a restart of pengwin #763

Open
puskyer opened this issue Feb 10, 2023 · 7 comments
Labels
Bug This is a problem.

Comments

@puskyer
Copy link

puskyer commented Feb 10, 2023

Describe the bug
when I first install screen it works, after shutting down mu notebook and rebooting it, screen returns "Cannot make directory '/run/screen': Permission denied"

To Reproduce
Steps to reproduce the behavior:

  1. install screen "sudo apt install screen"
  2. screen command works as it should.
  3. exit pengwin
  4. using powershell command terminate Wlinux ("wsl --terminate WLinux") or reboot notebook
  5. restart Pengwin
  6. run screen command and get the following error "Cannot make directory '/run/screen': Permission denied"
  7. typed running "/etc/init.d/screen-cleanup"
  8. still get error "Cannot make directory '/run/screen': Permission denied"
  9. typed running "sudo /etc/init.d/screen-cleanup"
  10. still get error "Cannot make directory '/run/screen': Permission denied"
  11. run "sudo apt purge screen"
  12. run "sudo apt install screen"
  13. screen works once more until I terminate pengwin or reboot my notebook

Expected behavior
screen command to work

Screenshots
after notebook reboot
#################
~$ screen
Cannot make directory '/run/screen': Permission denied
~$ /etc/init.d/screen-cleanup
~$ screen
Cannot make directory '/run/screen': Permission denied
~$ sudo /etc/init.d/screen-cleanup
[sudo] password for pusky:
~$ screen
Cannot make directory '/run/screen': Permission denied
$ sudo apt purge screen
[sudo] password for pusky:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
screen*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 1,038 kB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 65954 files and directories currently installed.)
Removing screen (4.8.0-6) ...
Processing triggers for man-db (2.10.1-1
bpo11+1) ...
(Reading database ... 65895 files and directories currently installed.)
Purging configuration files for screen (4.8.0-6) ...
removed '/etc/tmpfiles.d/screen-cleanup.conf'
$ sudo apt install screen
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Suggested packages:
byobu | screenie | iselect ncurses-term
The following NEW packages will be installed:
screen
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 609 kB of archives.
After this operation, 1,038 kB of additional disk space will be used.
Get:1 https://deb.debian.org/debian bullseye/main amd64 screen amd64 4.8.0-6 [609 kB]
Fetched 609 kB in 1s (749 kB/s)
Selecting previously unselected package screen.
(Reading database ... 65893 files and directories currently installed.)
Preparing to unpack .../screen_4.8.0-6_amd64.deb ...
Unpacking screen (4.8.0-6) ...
Setting up screen (4.8.0-6) ...
Processing triggers for man-db (2.10.1-1
bpo11+1) ...
~$ screen
[screen is terminating]
~$
################

Additional context
this happens everytime I reboot my notebook or terminate the wsl session.

Basic Troubleshooting Checklist

[ ] I have searched Google for the error message. (Yes)
[ ] I have checked official WSL troubleshooting documentation: https://docs.microsoft.com/en-us/windows/wsl/troubleshooting#confirm-wsl-is-enabled.
[ ] I have searched the official Microsoft WSL issues page: https://github.com/Microsoft/WSL/issues. (yes) "FYI: Search filter was is:issue is:open,closed '/run/screen' in:title,body"
[ ] I have searched the Pengwin issues page: https://github.com/WhitewaterFoundry/Pengwin/issues. (yes)
[ ] I have run Windows 10 updates and restarted. (Yes)
[ ] I have restarted WSL service: wsl.exe --terminate WLinux wsl.exe --shutdown. (yes)

What other troubleshooting have you attempted?

########
~$ /etc/init.d/screen-cleanup
~$ screen
Cannot make directory '/run/screen': Permission denied
~$ sudo /etc/init.d/screen-cleanup
[sudo] password for pusky:
~$ screen
Cannot make directory '/run/screen': Permission denied
#######
~$ mkdir ~/.screen && chmod 700 ~/.screen
~$ export SCREENDIR=$HOME/.screen
~$ screen
[screen is terminating]
~$
#########

Pengwin Version
PENGWIN_VERSION="22.11.4"

WSL general info
Release Install Date: Wed Dec 28 13:03:22 EST 2022
Branch: vb_release
Build: 19045
Full Build: 19041.1.amd64fre.vb_release.191206-1406
Display Scaling: 1
Locale (Windows): en_CA
Theme (Windows): dark
Uptime (Windows): 4d 20h 3m
Version (WSL): 2
Uptime (WSL): 0d 0h 29m
Release: Pengwin
Kernel: Linux 5.15.79.1-microsoft-standard-WSL2
Packages: 975
IPv4 Address: 172.21.184.154
System Type (Windows): Desktop
SystemD Status: disabled

@puskyer puskyer added the Bug This is a problem. label Feb 10, 2023
@puskyer
Copy link
Author

puskyer commented Feb 10, 2023

not sure why some of my test is crossed out? have tried to repast it but just getting worst??

@puskyer
Copy link
Author

puskyer commented Feb 10, 2023

ok did more research and found this entry https://stackoverflow.com/questions/45517515/running-screen-without-additional-permissions-on-wsl

I was using the 'sudo /etc/init.d/screen-cleanup' incorrectly it was to be 'sudo /etc/init.d/screen-cleanup start'

although this does fix the issue why do I need to run it when I need to use Screen? is init.d being used?

when i execute
sudo runlevel
[sudo] password for pusky:
unknown

do I need to install systemd and create a .service file?

thank you
Pasquale

@crramirez
Copy link
Collaborator

Hello @puskyer

Thanks for reporting and the detailed explanation. We will investigate if we can do something when the image is being created.

Regards,
Carlos

@puskyer
Copy link
Author

puskyer commented Feb 11, 2023

Thank you

@puskyer
Copy link
Author

puskyer commented Feb 12, 2023

hello @crramirez quick question

do you know how the /etc/boot.d work, I have enabled it using pengwin-setup.

is it like init.d and rcS.d?

right now I have the following in rcS.d
pusky@PuskyGaming:/etc/rcS.d$ ll
total 0
lrwxrwxrwx 1 root root 20 Nov 20 11:11 S01hwclock.sh -> ../init.d/hwclock.sh
lrwxrwxrwx 1 root root 14 Jan 18 22:58 S01kmod -> ../init.d/kmod
lrwxrwxrwx 1 root root 22 Jan 18 22:58 S01plymouth-log -> ../init.d/plymouth-log
lrwxrwxrwx 1 root root 16 Nov 20 11:12 S01procps -> ../init.d/procps
lrwxrwxrwx 1 root root 24 Feb 10 12:41 S01screen-cleanup -> ../init.d/screen-cleanup
lrwxrwxrwx 1 root root 14 Jan 18 22:57 S01udev -> ../init.d/udev
lrwxrwxrwx 1 root root 20 Nov 20 11:13 S01x11-common -> ../init.d/x11-common

even though S01screen-cleanup -> ../init.d/screen-cleanup is there and in init.d the screen-cleanup script is executable it does not execute at startup. Do I need to put something in /etc/boot.d ?

dos /etc/boot.d wotk the same Sxx.... or Kxx..., I will play with it and see..

thank you

FYI, I tried to add S01screen-cleanup -> /etc/init.d/screen-cleanup to the /etc/boot.d folder but it does not execute either.

@crramirez
Copy link
Collaborator

Hello @puskyer

It is indeed a hack. What pengwin does is execute the scripts in boot.d run-parts /etc/boot.d when the shell is started. It doesn't have anything to do with /etc/init.d

You can put the scripts you want to be started in /etc/boot.d or enable SystemD

Regards,
Carlos

@puskyer
Copy link
Author

puskyer commented Feb 19, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is a problem.
Projects
None yet
Development

No branches or pull requests

2 participants