March 7, 200917 yr When logged in via telnet, currently the only way to determine the version of unRAID is to look in the system log. This sometimes is important for those of us who write scripts to run on the the server. They can validate the version before continuing where necessary. Once Log-rotation is functional (hint-hint) a "grep" of syslog will no longer be a reliable method to determine the unRAID version. I would like to request that the current "version number" of unRAID be written to a file somewhere (/etc/unraid_version?) The actual file-name does not matter, as long as it can be accessed even if the syslog has been "rotated" out by a server that has been running for months. Joe L.
March 7, 200917 yr A better way than writing it to a file would be to expose it via the /proc/mdcmd interface, or an http get to the emhttp server.
March 7, 200917 yr /etc/unraid_version is the debian way. Ive no clue how slackware proper does it as Im a debian man. For such a trivial file i find myself for one reason or another looking at it quite often though.
March 7, 200917 yr I did a lot of research a while back as to how to pick up the unRAID version number. The only place I think it is stored is in emhttp. You could easily parse the binary and pull out the version number ("\0version={version}\0"). Best would be an enhancement from Tom to access this via mdcmd or some other structured way, as has already been noted.
March 7, 200917 yr Author A better way than writing it to a file would be to expose it via the /proc/mdcmd interface, or an http get to the emhttp server. /prod/mdcmd can only expose the "md" driver version. It has nothing at all to do with emhttp and the version of unRAID. The /proc interface is only available for kernel objects. emhttm is a user process. I don't think it can use /proc without changing it into a kernel module paired with a user-interface program. an http request can be done today, but it runs into issue when a password is set, unless you are able to issue a GET to a specific URL (or set of URLs) without dealing with having to embed a ID/PASSWORD in the request string. If there is no root password, it can be gotten with root@Tower:~# wget -q -O - localhost/main.htm | grep "version:" | sed -e "s/<[^>]*>//g" version: 4.4.2 Joe L.
March 7, 200917 yr According to google established slackware convention closes matched debian: /etc/slackware-version It also seems many other distributions follow this as well. To my eye it seems logical to follow this route as well. I like the idea of "easily parse the binary and pull out the version number ("\0version={version}\0")." but i would then be placing the results in the version file to save the need for subsequent parsing. What would the exact command be for this kind of parse?
March 7, 200917 yr Author According to google established slackware convention closes matched debian: /etc/slackware-version It also seems many other distributions follow this as well. To my eye it seems logical to follow this route as well. I like the idea of "easily parse the binary and pull out the version number ("\0version={version}\0")." but i would then be placing the results in the version file to save the need for subsequent parsing. What would the exact command be for this kind of parse? Try this: strings /usr/local/sbin/emhttp | grep version= version=4.4.2 No worry about a password at all, or networking, or anything we don't currently have available. It will work as long as the searched for "string" contains "version=" Joe L.
March 7, 200917 yr The /proc interface is only available for kernel objects. emhttm is a user process. I don't think it can use /proc without changing it into a kernel module paired with a user-interface program. True, but the structure can be written to by emhttp, so it is available via /proc/mdcmd. The problem with greping emhttp on disk, is that it might not be the actually running copy. (I admit, this is highly unlikely!) I'll add an emhttp grep to the code that populates unraid->current_version I don't think it should be unRAID-Web that writes the /etc/unraid_version file. Folks can add an emhttp grep in their go script and echo > /etc/unraid_version if they want.
March 7, 200917 yr Author The /proc interface is only available for kernel objects. emhttm is a user process. I don't think it can use /proc without changing it into a kernel module paired with a user-interface program. True, but the structure can be written to by emhttp, so it is available via /proc/mdcmd. So obvious (now that you mention it), and so true*. It can be as simple as a parameter that can be set by emhttp with something like mdcmd set version 4.4.1 Joe L. *I feel so dumb... I should have thought of using /proc/mdcmd in that way myself.
Archived
This topic is now archived and is closed to further replies.