SYSV init discussion

You can test this way:

  1. Preinst does all the validation, passively. The host is not touched in any way except to write the results to the temp file in /tmp
  2. This passing, Postinst reads the temp file to guide actual configuration

By re-running ./Postinst, you can test various configurations.

Since all actions are === printed, you can edit the temp file to see how it handles different configurations when actually installing.

I am ready to test.

Please let me know when everyone is.

Postinst gives me an error about journald:
logger: unrecognized option ‘–journald’

I assume it is from line 22:
echo MESSAGE=“PlexMediaServer installer: $*” | logger --journald

Init systems won’t have journald and Devuan does not even have the --journald option. Removing the --journald and just having logger results in it working fine.

My output:
Plex now configuring based on:
Process Control: Init
Plex User: plex
Plex Group: plex
Video Group: video
Metadata Dir: /var/lib/plexmediaserver/Library/Application Support
Temp Directory: /tmp
Lang Encoding: en_US.UTF-8
Config file used: /etc/default/plexmediaserver
HW transcoding: Not found

Completing final configuration on your system.
===groupadd plex
===usermod -a -G plex plex
===usermod -a -G video plex
===SUBSYSTEM==“usb”, ATTRS{idVendor}==“1d19”, ATTRS{idProduct}==“0100”, GROUP=“video” , MODE=“0660” > /lib/udev/rules.d/60-tv-butler.rules
===SUBSYSTEM==“drm”, GROUP=“video” , MODE=“0660” > /lib/udev/rules.d/60-plex-hw-transcoding.rules
===udevadm control --reload-rules
===udevadm trigger
===/usr/sbin/update-rc.d plexmediaserver defaults
===service plexmediaserver restart
Catastrophic failure during installation. Please save file: /tmp/plexinstaller.log and seek help in our Support Forums.

Plex Media Server installation configuration info: Fri May 24 07:24:47 MDT 2019
Init=1
Systemd=0
IsEnabled=0
IsRunning=13
NewInstall=0
HaveOverride=1
OverrideFile="/etc/default/plexmediaserver"
PlexUser=“plex”
PlexGroup=“plex”
VideoGroup=“video”
AppSuppDir="/var/lib/plexmediaserver/Library/Application Support"
PlexTempDir="/tmp"
LangEncoding=“en_US.UTF-8”
HaveHardware=0
NeedUser=0
NeedGroup=0
NeedDirs=0
NeedVideo=1
NeedUdev=0
NeedOwner=0
Verbose=1

I’ll be able to test further later.

Yes, that was fromthe logger. The logger is now fully system-type sensitive and writes accordingly.

Attaching current-state Pre and Post install scripts:

Current Debian 9 output (will gladly tweak) is as follows:

chuck@debian9-init:~/git/postprocessor/output-all$ sudo dpkg -i plexmediaserver_1.15.8.1146-38cea315a_amd64.deb
(Reading database ... 156357 files and directories currently installed.)
Preparing to unpack plexmediaserver_1.15.8.1146-38cea315a_amd64.deb ...
Plex Media Server installation - Pre-installation validation.                  
Warning: PLEX_MEDIA_SERVER_USER is obsolete.  Please use PLEX_USER to override the default username in /etc/default/plexmediaserver.  Retaining:  plex                  
Stopping Plex Media Server...
Unpacking plexmediaserver (1.15.8.1146-38cea315a) over (1.15.8.1146-38cea315a) ...
Setting up plexmediaserver (1.15.8.1146-38cea315a) ...
Installing new version of config file /etc/init.d/plexmediaserver.init ...
Plex Media Server is not running.
                   
Plex now configuring based on:                  
  Process Control:    Init                  
  Plex User:          plex                 
  Plex Group:         plex                 
  Video Group:        video                 
  Metadata Dir:       /var/lib/plexmediaserver/Library/Application Support                
  Temp Directory:     /tmp                 
  Lang Encoding:      en_US.UTF-8                 
  Config file used:   /etc/default/plexmediaserver                 
  HW transcoding:     Not found                  
                   
Completing final configuration.                  
insserv: script plexmediaserver.init: service plexmediaserver already provided!
Plex Media Server is not running.
Starting Plex Media Server...
PlexMediaServer-1.15.8.1146-38cea315a - Installation successful.                  
Processing triggers for libc-bin (2.24-11+deb9u4) ...
Processing triggers for systemd (232-25+deb9u11) ...
Processing triggers for gnome-menus (3.13.3-9) ...
Processing triggers for desktop-file-utils (0.23-1) ...
Processing triggers for mime-support (3.60) ...
chuck@debian9-init:~/git/postprocessor/output-all$ ps -ef | grep -i plex
plex     18876     1  4 13:48 ?        00:00:00 /usr/lib/plexmediaserver/Plex Media Server
plex     18896 18876 32 13:48 ?        00:00:02 Plex Plug-in [com.plexapp.system] /usr/lib/plexmediaserver/Resources/Plug-ins-38cea315a/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.15.8.1146-38cea315a /usr/lib/plexmediaserver/Resources/Plug-ins-38cea315a/System.bundle
plex     18949 18876  3 13:48 ?        00:00:00 /usr/lib/plexmediaserver/Plex DLNA Server
plex     18951 18876  0 13:48 ?        00:00:00 /usr/lib/plexmediaserver/Plex Tuner Service /usr/lib/plexmediaserver/Resources/Tuner/Private /usr/lib/plexmediaserver/Resources/Tuner/Shared 1.15.8.1146-38cea315a 32600 /waitmutex
plex     19014 18876 32 13:48 ?        00:00:01 Plex Plug-in [com.plexapp.agents.imdb] /usr/lib/plexmediaserver/Resources/Plug-ins-38cea315a/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.15.8.1146-38cea315a /usr/lib/plexmediaserver/Resources/Plug-ins-38cea315a/PlexMovie.bundle
chuck    19100  2951  0 13:48 pts/0    00:00:00 grep -i plex
chuck@debian9-init:~/git/postprocessor/output-all$ 

Complete set below
PMS-SYSV-init.tar.gz (8.6 KB)

EDIT : Init.d warning resolved.

Moved backup copies of /etc/default/plexmediaserver to /usr/lib/plexmediaserver/lib
Did same for /etc/init.d/plexmediaserver

I think it is best to move any existing /etc/init.d/plexmediaserver to /etc/init.d/plexmediaserver.dpkg-old. I’m not sure how Debian does it, but when the installing some packages when things like the init script or conf files have been modified, a dialog pops up to keep, replace, diff, etc. I think this would be an important step if anyone make any custom changes.

Everything is looking really good Chuck.

When I had more than one plexmediaserver.anything , it issued the warning.

I am finding it cleaner to leave the pristine copy away from /etc in both Ubuntu and Debian 9

Dialog popups aren’t possible because I cannot tell if the package is being installed by a script or at the console.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.