June 29, 201511 yr Can someone take a look at this .plg for me, I only have a vague understanding of what I am doing with the .plg file and used one of PhAzEs .plg's as a starting point. This plg is just to help make it easier to install and remove the alternative webgui I am working on http://lime-technology.com/forum/index.php?topic=32064.0, and is really only for testing at the moment as it's not very feature complete. I am trying to get the built in PHP server running in the background and using: echo -e "\t Starting PHP server" nohup php -S 0.0.0.0:8888 -t "$LOCALLOC/&name;/" > /dev/null 2>&1 & echo "...Install complete!" Now "...Install complete!" is showing which suggests it has indeed launched in the background (when just using php -S 0.0.0.0:8888 -t "$LOCALLOC/&name;/" I never saw "...Install complete!" as it was waiting for input), however, the done button doesn't show. While the install plugin dialog box is open if I go to http://myserverip:8888 the webgui shows up, but if I close the dialog it stops running. Any ideas? Also if anyone has any suggestions on resources to look at for creating .plg files please let me know.
June 29, 201511 yr Can someone take a look at this .plg for me, I only have a vague understanding of what I am doing with the .plg file and used one of PhAzEs .plg's as a starting point. This plg is just to help make it easier to install and remove the alternative webgui I am working on http://lime-technology.com/forum/index.php?topic=32064.0, and is really only for testing at the moment as it's not very feature complete. I am trying to get the built in PHP server running in the background and using: echo -e "\t Starting PHP server" nohup php -S 0.0.0.0:8888 -t "$LOCALLOC/&name;/" > /dev/null 2>&1 & echo "...Install complete!" Now "...Install complete!" is showing which suggests it has indeed launched in the background (when just using php -S 0.0.0.0:8888 -t "$LOCALLOC/&name;/" I never saw "...Install complete!" as it was waiting for input), however, the done button doesn't show. While the install plugin dialog box is open if I go to http://myserverip:8888 the webgui shows up, but if I close the dialog it stops running. Any ideas? Also if anyone has any suggestions on resources to look at for creating .plg files please let me know. Real quick, I remember some posts about this. The background process is still tying up the window. What I think you should try is running a background script which then calls the background process. Just woke up however so could be completely off base
June 29, 201511 yr Have the install.plg script schedule the another script to execute via "at" or "cron" instead of executing directly.
June 29, 201511 yr You can have a look at the PLG files I have created for s3_sleep and cache_dirs. These have a workaround in place to cope with the process start in the background using the 'at' command.
June 29, 201511 yr Author Thanks bonienl, I got that working by adding: <!-- Workaround to start service. --> <FILE Name="/tmp/start_service"> <INLINE> #!/bin/bash LOCALLOC="/boot" nohup php -S 0.0.0.0:8888 -t "$LOCALLOC/&name;/" > /dev/null 2>&1 & </INLINE> </FILE> <!-- The 'post-install' script. --> <FILE Run="/bin/bash"> <INLINE> # Start service at -M -f /tmp/start_service now 2>/dev/null rm -f /tmp/start_service echo "...Install complete!" </INLINE> </FILE> Can I add a variable that is used throughout? I tried adding something like <!ENTITY localLoc "/boot"> so I could use &localLoc; instead of setting LOCALLOC="/boot"="/boot" in each place and using $LOCALLOC, but that errored (I'm guessing there are specific entity names).
June 29, 201511 yr Author Ignore that, I just tried it again and it worked fine, I set <!DOCTYPE PLUGIN [ <!ENTITY name "Cerberus"> <!ENTITY displayName "Cerberus WebGUI"> <!ENTITY author "Kode"> <!ENTITY plgVersion "2015.06.29"> <!ENTITY pluginURL "https://bitbucket.org/Kode/unraid/raw/master/plugins/cerberus-flash.plg"> <!ENTITY appURL "https://bitbucket.org/Kode/cerberus/get/HEAD.zip"> <!ENTITY installDir "/boot"> ]> <PLUGIN name="&name;" author="&author;" version="&plgVersion;" pluginURL="&pluginURL;" installDir="&installDir;" > Not sure if it's needed in the PLUGIN section as well? Either way it seems to work
Archived
This topic is now archived and is closed to further replies.