by carlettod » Thu Apr 26, 2012 12:49 pm
Dear happy.neko,
I have posted a message in "Linux" section of this forum for my new start/stop procedure (initscript and default files) for demonized version of PS3 Media Server.
I have been testing this procedure on my Ubuntu 11.10 (64bit) headless system, also with you deb package, in all possible instances (start, stop, status, restart, "restart" in case of daemon crash, "stop" in case of running a multimedia stream) without any problem having been found.
As I wrote in that message, the new init procedure has the following features and advantages:
- a very clear and simple structure of the two files (initscript and default);
- its full compatibility with the LSB standard (both Debian, Ubuntu and derivates);
- full PIDFILE support;
- the presence of the PIDFILE allows to identify the correct java daemon process of PS3 Media Server in order to avoid confusion with other instances of same program started from the GUI;
- full support of LSB "log_*" message functions;
- full support for the "start-stop-daemon" procedure (both in the start and stop of the daemon);
- high reliability in case of crash of java processes of PS3 Media Server.
- management and correct use of the "PMS_PROFILE" environment variable – this is read by PS3 Media Server when it starts (variable "P3MS_PROFILE" in the old initscript was wrong);
- shift of all PS3 Media Servers specific variables to "/etc/default/ps3mediaserver" file with full detailed instructions;
- opportunity to run the daemon with a different user in only three simple steps (described in file "/etc/default/ps3mediaserver");
- in accordance with the Debian standard, configuration files of daemons necessarily need to be placed in /etc subfolder. So in the new procedure files of system profile ("PMS.conf" and WEB.conf") are now read as default directly from folder "/etc/ps3mediaserver" (that is suitables for happy.neko deb package);
- Variables values are based on files structure of happy.neko deb package. If user want change location (e.g. "/opt/ps3mediaserver" - to use the initscript with downloaded linux package from PS3MS web site), it has to change only three variables: "PMS_PROFILE" variable in "/etc/default/ps3mediaserver" file; "NAME" and "DAEMON" variables in "/etc/init.d/ps3mediaserver" file; if you change the variable "NAME" please be careful to rename "/etc/default/ps3mediaserver" file also;
- for headless mode (daemon need this) now it uses "JAVA_OPT" variable with value "-Djava.awt.headless=true" that, based on my experience, in presence of some particular graphical environment, is more reliable than "DAEMON_OPTS" variable with value "console".
- high reliability in case of crash of java processes of PS3 Media Server.
If you want to add the new procedure to your new deb package, changes are needed in its control files.
Please find below a list of files I changed (from the latest version of your package), with details about changes I made in each of these:
- conffiles
In this file I added references to new configuration files "/etc/ps3mediaserver/PMS.conf" and "/etc/ps3mediaserver/WEB.conf" and I removed references to old files under "/root/.config/ps3mediaserver" because the latter are directly eliminated in case of a "purge" from "postrm" script;
- postinst
I added a copy from "/etc/skel/.config/ps3mediaserver" of the two files ("PMS.conf" and "WEB.conf"), if not existing, to folder "/etc/ps3mediaserver".
Conversely, if an upgrade is made from a previous version, the script will copy these two configuration files from "/root/.config/ps3mediaserver" folder in order to retain all settings from the previous versions;
- postrm
I only removed a number of unnecessary file deletion items as items are already removed by "dpkg" package manager.
Please find attached the three control files I modified in "ps3ms_deb_control_files.zip" file.
Obviously I could not test operation of the deb package!
I am available to test its full operation (install, remove and purge) prior to the official posting in your repository.
To do so, if you want, you can send me a private message with a link for download when you have changed it (I have a 64 bit Ubuntu).
I hope that my work will be instrumental in the improvement of your project.
I look forward to your instructions,
Kind regards,
Carlo
P.S.
I am also available, if you want modify them, to test the control files to fit full Debian standard.
Only for example, some of the problems (already reviwed in forum) are:
- avoid creation of config file for all users (and root user) in their home directories when deb is installed; let PS3 Media Server to create the default settings when it starts only for the user that has executed program;
- two daemon profile files (PMS.conf and WEB.conf) now in "/etc/ps3mediaserver" should be in "data" of deb package. This ensure correct update of this files in future release.
- actually, in your deb, user profile files are copied from "/etc/skel/.config/ps3mediaserver" when package is installed. This is not a good practice in debian world.
Usually the skel configs for users are located only under documentation (already present in "/usr/share/doc/ps3mediaserver/examples").
If a user wants to start from your preset defaults, he have to make a copy from ".../doc/..." in its home.
- Attachments
-
ps3ms_deb_control_files.zip
- (2.61 KiB) Downloaded 27 times