Jump to content

dlandon

Community Developer
  • Posts

    10,216
  • Joined

  • Last visited

  • Days Won

    20

Everything posted by dlandon

  1. No. This is what I am talking about: <!-- The 'update' script. --> <FILE Run="/bin/bash" Method="update"> <INLINE> rm -f -r /usr/local/emhttp/plugins/&name; </INLINE> </FILE>
  2. I have figured out how to do this, but I wonder if an 'update' method would be appropriate.
  3. When I am updating a plugin I want to remove the /usr/local/emhttp/plugin/ directory for my plugin before the update is applied so any changes in the files will be written. What is the best way to do that?
  4. It's leftover from a previous install of older openvpnserver plugin. This is on a test server that I loaded the openvpnclient as a test. My other server has never had that installed and it also has it. After a clean re-boot - no plugins? How do I get rid of it? EDIT: After a safe mode boot: total 4 -rw-r--r-- 1 root root 1 Aug 31 19:33 openvpnserver lrwxrwxrwx 1 root root 49 Aug 31 19:33 unRAID-OS -> /usr/local/emhttp/plugins/unRAID-OS/unRAID-OS.plg In the ram image? Both files are dated the same day and time. 6b8 was released 8/31.
  5. After I boot up unRAID with no plugins I see this in /var/log/plugins: total 4 -rw-r--r-- 1 root root 1 Aug 31 19:33 openvpnserver lrwxrwxrwx 1 root root 49 Aug 31 19:33 unRAID-OS -> /usr/local/emhttp/plugins/unRAID-OS/unRAID-OS.plg What is the openvpnserver file? Is this correct? It is not a symlink.
  6. A couple of suggestions: Based on a post by Tom: /usr/local/emhttp/plugins/ssh/Ssh.page # page file for webGui menu system /usr/local/emhttp/plugins/ssh/Ssh.php # webGui page code It seems that the page file and the php have to both be exactly the same name. I think his idea here is to insure the icons are in alphabetic order in the settings page. Also the versioning standard seems to be year.month.day for plugins.
  7. UnRaid has a problem with certain names. Had the same issue with apcupsd. Use name; variable for all references to the plugin name rather than hard coding to make this easier to change.
  8. In the example I gave in the OP, the icon is expected to be: /usr/local/emhttp/plugins/ntfs-3g/ntfs-3g.png Be sure your .png is named this way. The line: <!ENTITY pluginURL "https://github.com/dlandon/unraid-snap/raw/master/ntfs-3g-x86_64.plg"> is used to check for a new plugin version. In a telnet session, verify you can do a wget on this url without any errors. I also had a situation where the name I was using in one plugin was not accepted by plgman. When I changed the name, it worked properly. Does your README.me content show up on the plugin page?
  9. My OP was asking how the plugin manager worked on V6. After a week of working with several of my plugins, I have learned a lot (geez, that hurts the brain) and I have modified my OP to document what I know at this time. I'm not sure how complete my write up is, but it should help those of you wanting to convert V5 plugins, or author a new plugin for V6. Let me know if there is anything that is incorrect or incomplete. I will do my best to keep the OP up to date. Tom or Jonp, please comment if I have gotten anything incorrect or incomplete.
  10. I would take a look at the dockerMan plugin. It's nicely written. A few things I've learned: - The 'name' you assign to the plugin has a lot of importance. The name should be the sub-directory off the /usr/local/emhttp/plugins path. - Your icon should be named the same with a .png extension in that same sub-directory. - A READ.me file in the same sub-directory will be displayed on the plgman page. - Be sure to include a script with 'remove' method so your plugin can clean up all that is necessary when plgman removes your plugin. Remove packages, delete files from the flash drive, etc. If you'd like, pm me and I'd be happy to review your plugin and give you some ideas. By no means am I an expert, but the last week has been a steep learning curve for me and I have learned a lot about plugins. I have to say it is a pretty slick system. There seems to be one small issue with updating a plugin - it doesn't load on the next boot.
  11. Are you saying that part of installation of the script starts a background process? Yes. Hmm probably the process is still owned by the process running the 'plugin install' and so the latter process won't exit. Instead of task & try nohup task & Solved by using the 'at' command to schedule the script to run. The rc.snap start calls a script that puts an inotify script in the background. <!-- Snap start up script. --> <FILE Name="/tmp/start_snap.sh"> <INLINE> <![CDATA[ #!/bin/bash /etc/rc.d/rc.snap start rm /tmp/start_snap.sh ]]> </INLINE> </FILE> <!-- Snap install. --> <FILE Name="/tmp/SnapInstall.sh" Run="/bin/bash"> <INLINE> <![CDATA[ #!/bin/bash # # Start SNAP and mount any SNAP (usb) drives found. # echo "Starting Snap..." at -f/tmp/start_snap.sh now echo "Snap installation complete..." rm /tmp/SnapInstall.sh ]]> </INLINE> </FILE>
  12. Are you saying that part of installation of the script starts a background process? Yes.
  13. I'm having an issue with SNAP plugin installation through the Extensions install. The plugin installs correctly and I echo one last message that snap is installed, but it never exits the plugin installation. The 'Close' button doesn't show up. I am running a background task in snap (inotify) and when I comment that out of the script, the 'Close' button shows up. Something is hanging the plugin installation. I am running the task in the background like this: task & Maybe there is more I need to do.
  14. Ok. Thanks, quite straight forward. I've installed the plugins from the 'Extensions' page, but when I update a plugin, the /boot/config/plugins/ntfs-3g-x86_64.plg gets erased and a plugsntfs-3g-x86.plg is created in the /boot/config directory, but on a re-boot the plugin does not load.
  15. I'm working on some documentation and guidelines for Plugin Developers which will show up in a wiki on limetech github. For now: for unRaid 6, do not manually place plugin files directly into /boot/config/plugins. The proper way to install a plugin is to do via the Extension page under Install extension. Please attach your plg file and let me take a look. I added .plg in the list of attachable files for the forum. Attached. I'd also like to know how to add the description to the plugins page. ntfs-3g-x86_64.plg
  16. This is pretty exciting stuff. Updates will be easier and less prone to operator error. Anything that can cut down on operator mistakes will make for a lot less support and a happier user. Great work LT!
  17. unRAID V6 Plugins I started out asking how the plugin system works, and while implementing some plugins, I learned a lot about how it works. V6b8 has brought in a totally new plugin system compared to V5 that is more flexible, easier to use, and helps sort out the "What plugins do I have installed and what versions are they?" questions. While I don't profess to be an expert at the plugin system, I wanted to start a post to help those wanting to convert V5 plugins or author new plugins. If the plugins follow the proper structure, the plugin manager (plgman) can check for the latest version, update, and remove plugins cleanly while unRAID is on-line. There are some best practices to be followed with the new plgman. Install plugins in the "Install Extensions" field in the "Extensions" tab. Don't install plugins by putting then in the flash drive. Plgman needs to manage the plugin for proper operation. You can enter a URL or a plugin file on unRAID to install. Remove plugins through the plgman webpage. Use plgman to update plugins. I will use the ntfs-3g plugin I wrote for V6 as an example. It does not have a webpage in unRAID, but I'll go through what needs to be done so unRAID will understand how to use the webpage. Start off in your plug in with: <?xml version='1.0' standalone='yes'?> <!DOCTYPE PLUGIN [ <!ENTITY name "ntfs-3g"> <!ENTITY author "dlandon"> <!ENTITY version "2014.09.05"> <!ENTITY pluginURL "https://github.com/dlandon/unraid-snap/raw/master/ntfs-3g-x86_64.plg"> ]> <PLUGIN name="&name;" author="&author;" version="&version;" pluginURL="&pluginURL;"> The describes your plugin to the unRAID plgman. name - this is the name of you plugin. This name should be the sub-directory for you plugin off the /usr/local/emhttp/plugins/ directory and is where your plugin files are located. Plgman uses the name to find your plugin, and the icon associated with the plugin. The icon should be named 'name.png'. Plgman uses this information to display information about your plugin. author - Information field for plgman to display. version - Plgman displays the version and uses this version to check for an updated version in your repository. The convention is year.month.day. If several releases occur in the same day, use the convention year.month.day-x, where x-=1,2,... pluginURL - The is the web URL to the repository where your plugin is stored. Plgman uses it to look for the latest version of your plugin. It is best to use a generic name for your plugin and not have the name include a version. The versioning is done inside the plugin. <!-- 2013-10-19 - first release 2014-01-24 - Modified for unRAID 6 (64 bit) The plugin provides ntfs-3g support for unRAID systems. --> It is a good idea to include some comments or further information about the plugin. This would be a good place for a license. <FILE Name="/boot/packages/ntfs-3g-2013.1.13-x86_64-1.txz" Run="upgradepkg --install-new"> <URL>http://slackware.oregonstate.edu/slackware64-14.1/slackware64/a/ntfs-3g-2013.1.13-x86_64-1.txz</URL> <MD5>de646f44d881b6c4292e353b717792cd</MD5> </FILE> This is the ntfs-3g package that is installed. This could be a tar bundle that you expand into the the /usr/local/enhttp/plugins/name. If you download a tar bundle, store a copy on the flash at /boot/config/plugins/name so it doesn't have to be downloaded each time the plugin is installed. Packages are stored on the flash at /boot/packages. <FILE Name="/boot/config/plugins/&name;/ntfs-3g.png"> <URL>https://github.com/dlandon/unraid-snap/raw/master/ntfs-3g.png</URL> </FILE> This is the icon used for the ntfs-3g plugin. I would recommend that you put this into the bundle for the plugin structure you download if possible. <FILE Name="/usr/local/emhttp/plugins/&name;/ntfs-3g.png"> <LOCAL>/boot/config/plugins/&name;/ntfs-3g.png</LOCAL> </FILE> This does nothing more than make a copy of the stored ntfs-3fg icon on the flash drive into the plugin file structure. <!-- Page file --> <FILE Name="/usr/local/emhttp/plugins/&name;/Apcupsd.page"> <INLINE> <![CDATA[ Menu="OtherSettings" Icon="apcupsd.png" Version="2014.09.06" Author="SeeDrs" Title="APC UPS" --- <?php php goes here. ?> ]]> </INLINE> </FILE> Plugin Page File The page file is used by emhttp to display and render your webpage. The page file must begin with a capital letter, and your php included in the page file. This is the page file from the Apcupsd plugin as an example. The 'Menu' setting is important because this is the area in 'Settings' where emhttp will install the icon. <!-- create plugin README.md file --> <FILE Name="/usr/local/emhttp/plugins/&name;/README.md"> <INLINE> **NTFS-3G Package** The ntfs-3g driver package is needed for writing on NTFS formated disks. The built in NTFS driver is read only. </INLINE> </FILE> README File The READ.me is used by plgman to dispay in the plugin webage. Use it to describe your plugin. Again, I recommend that you put this file in your tar bundle if it is possible to save this step. Remove Method <!-- The 'remove' script. --> <FILE Run="/bin/bash" Method="remove"> <INLINE> rm /boot/packages/ntfs-3g-2013.1.13-x86_64-1.txz removepkg &name; rm -r /usr/local/emhttp/plugins/&name; rm -r /boot/config/plugins/&name; </INLINE> </FILE> </PLUGIN> This is the remove script executed when plgman is asked to remove the plugin. Do any package removal and clean up necessary to remove all traces of the plugin. There are some cli commands that you can use for development and testing of your plugin: plugin install - Install the plugin. plugin delete name - This is how you remove a plugin. The 'name' is the name of your plugin. plugin update name - This will update your plugin. If you have made changes to the plugin, this will re-install the plugin with your changes. This is how plgman does a plugin update. It downloads the new plugin first, then runs the update. plugin check name - Check for a new version of your plugin. I know this is not complete and I would like input from Tom or Jonp if there is anything I need to correct/add. I would rather them spend time on the core functionality at this point and not spend their time on documentation. UPDATE: V6 beta11 has depricated 'category'. It is no longer used. The emhttp file structure in beta 12 has been changed. You can no longer have a .page file with a separate .php file of the same name. Your php is expected in the .page file. The php is separated in the .page file with '---'. The following is a work around to this limitation. This is the Snap.page from the updated snap plugin. Menu="OtherSettings" Icon="snap.png" Version="6.04" Author="Queeg/dlandon" Title="SNAP" --- <?php shell_exec('php /usr/local/emhttp/plugins/snap/Snap.php'); ?> Dynamix V6b12 incorporated dynamix as the default webgui. Dynamix has a process status indicator built into every plugin webpage you can use. This is how I did it in the apcupsd plugin: $sName = "apcupsd"; <script> $(function() { showStatus('<?=$sName?>'); }); </script> Dynamix checks for the existence of the pid file 'apcupsd.pid' and shows 'Running' if it exists, and 'Stopped' if it is not found. You should incorporate this indicator to be consistent with other dynamix web pages. This should be put at a place in your page refresh where the pid status would be valid. Notifications v6b12 now has an email and webgui notification system. /usr/local/sbin/notify -e "title of the message" -s "subject of the message" -d "additional information" -i "normal" The -i parameter specificies the importance level: normal, warning or alert Tabbed Menu Dynamix has rhe ability to use a tabbed system for plugins. The following is from the apcupsd plugin: Acpupsd.page Menu="OtherSettings" Title="APC UPS" Type="xmenu" Icon="apcupsd.png" Tabs="true" --- ApcupsdSettings.page u="Apcupsd:1" Title="UPS Settings" --- <?PHP ApcupsdStatus.page Menu="Apcupsd:2" Title="UPS Status" --- <?PHP Changelog A changelog can be displayed after the check for updates. Add the following to the plugin to display the changelog: <CHANGES> ###2014-12-07 - Made a change - Made another change </CHANGES>
  18. +1 I restore vintage tube radios. What a waste of a really nice radio.
  19. There is an issue with the CPU and MB temperatures. This line in the SystemTemps.php sorts the temperatures and the lowest one always shows first (left position) on the webpage. exec("sensors -A|awk '/^CPU Temp/ {print $3*1}; /^M\/?B Temp/ {print $3*1}'",$temp); No matter which temperature is associated with the CPU and MB, the lowest temperature will always show first on the left. In my case the MB temp is lower so it shows in the CPU temperature position. Really a minor issue, but may cause some consternation when trying to get the temperatures to show in the correct positions.
  20. There is a new version of powerdown that can help with the start and stop process. Powerdown is installed by Dynamix, and the apcupsd plugin. The apcupsd plugin for V6 has not been updated yet, but it's a simple matter to change the one you have to install the latest powerdown package. You can also install powerdown as a stand alone plugin. This post http://lime-technology.com/forum/index.php?topic=31735.0 describes how it works.
  21. That is the latest version. Joe didn't change the version message in the script.
×
×
  • Create New...