Difference between revisions of "Linux-hda commands"

From Amahi Wiki
Jump to: navigation, search
 
(60 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 +
= Linux Basic Commands =
 +
[[Basics|Linux Basic Commands]] most users will need.
 +
 
= General Linux/HDA Commands =
 
= General Linux/HDA Commands =
  service httpd start = restart web server
+
Fedora (root user)
  yum -y update = Automatically update fedora
+
<table border="1">
  rpm -Uvh http://dl.getdropbox.com/u/364883/Amahi/hda-platform-*.*-*.noarch.rpm = updates HDA
+
<tr>
  rpm -q hda-platform = check to see what version of HDA your running.
+
<th>Command</th>
 +
<th>Action</th>
 +
</tr>
 +
<tr>
 +
<td>systemctl restart httpd.service</td>
 +
<td>restart web server</td>
 +
</tr>
 +
<tr>
 +
<td>dnf -y update</td>
 +
<td>automatically update Fedora</td>
 +
</tr>
 +
<tr>
 +
<td>rpm -q hda-platform</td>
 +
<td>check to see what version of HDA you're running</td>
 +
</tr>
 +
</table><br />
 +
Ubuntu (precede with sudo)
 +
<table border="1">
 +
<tr>
 +
<th>Command</th>
 +
<th>Action</th>
 +
</tr>
 +
<tr>
 +
<td>service apache2 restart</td>
 +
<td>restart web server</td>
 +
</tr>
 +
<tr>
 +
<td>apt-get -y upgrade</td>
 +
<td>automatically update Ubuntu</td>
 +
</tr>
 +
</table><br />
  
 
= HDA Script Commands =
 
= HDA Script Commands =
* Must be run from the '''''/var/hda/platform/html/script''''' directory:
 
<pre>first-admin = returns name of first admin user</pre>
 
<pre>reset-user-password = reset a forgotten user password
 
Syntax: reset-user-password user</pre>
 
* Can be run from anywhere:
 
<pre>hda-change-gw = change gateway/router IP address
 
Syntax: hda-change-gw xxx.xxx.xxx.xxx</pre>
 
<pre>hda-change-dns = change DNS provider for HDA</pre>
 
<pre>hda-install-gem = install Ruby Gems</pre>
 
<pre>hda-create-db-and-user = create MySql user and database
 
Syntax: hda-create-db-and-user database</pre>
 
<pre>hda-new-install = manual install for Amahi
 
Syntax: hda-new-install code</pre>
 
<pre>hda-php-zone-change = change time zone</pre>
 
<pre>hda-refresh-shares = refresh HDA shares</pre>
 
<pre>hda-updates = check for HDA platform updates</pre>
 
  
= Linux Basic Commands =
+
'''NOTE:'''  Must be run from the '''''/var/hda/platform/html/script''''' directory.
[[Basics|Linux Basic Commands]] most users will need.
+
 
 +
<table border="1">
 +
<tr>
 +
<th>Command</th>
 +
<th>Action</th>
 +
</tr>
 +
<tr>
 +
<td>first-admin</td>
 +
<td>returns name of first admin user</td>
 +
</tr>
 +
<tr>
 +
<td>[[Reset_Amahi_Password|reset-user-password]]</td>
 +
<td>reset a forgotten user password</td>
 +
</tr>
 +
</table>
  
= uShare =
 
  service amahi-ushare restart = restart ushare after adding new content
 
  
= VNCServer =
+
'''NOTE:'''  Can be run from anywhere (located in '''/usr/bin''').
  vncserver = Starts the VNCServer
 
  vncserver -kill :1 = Stops the VNCServer
 
  
= mt-daapd =
+
<table border="1">
  /etc/init.d/mt-daapd start
+
<tr>
  /etc/init.d/mt-daapd stop
+
<th>Command</th>
 +
<th>Action</th>
 +
</tr>
 +
<tr>
 +
<td>hda-change-gw</td>
 +
<td>change gateway/router IP address</td>
 +
</tr>
 +
<tr>
 +
<td>hda-change-dns</td>
 +
<td>change DNS provider for HDA</td>
 +
</tr>
 +
<tr>
 +
<td>
 +
hda-install-gem</td>
 +
<td>install a specific Ruby Gem</td>
 +
</tr>
 +
<tr>
 +
<td>[[Application_Install_Scripts#hda-create-db-and-user utility script|hda-create-db-and-user]]</td>
 +
<td>create MariaDB user and database</td>
 +
</tr>
 +
<tr>
 +
<td>hda-new-install</td>
 +
<td>DEPRECATED</td>
 +
</tr>
 +
<tr>
 +
<td>hda-php-zone-change</td>
 +
<td>change time zone</td>
 +
</tr>
 +
<tr>
 +
<td>hda-refresh-shares</td>
 +
<td>refresh HDA shares</td>
 +
</tr>
 +
<tr>
 +
<td>hda-alias</td>
 +
<td>SYSTEM USE ONLY</td>
 +
</tr>
 +
<tr><td>hda-fix-sudoers</td>
 +
<td>SYSTEM USE ONLY</td>
 +
</tr>
 +
<tr><td>hda-install</td>
 +
<td>Amahi 7 or greater ONLY</tr>
 +
<tr><td>hda-install-file</td>
 +
<td>SYSTEM USE ONLY</td>
 +
</tr>
 +
<tr><td>hda-register-apps</td>
 +
<td>SYSTEM USE ONLY</td>
 +
</tr>
 +
<tr><td>hda-settings</td>
 +
<td>Dumps current settings</tr>
 +
<tr><td>hda-update-webapps</td>
 +
<td>SYSTEM USE ONLY</td>
 +
<tr><td>hda-add-apache-sudoers</td>
 +
<td>SYSTEM USE ONLY</td>
 +
</tr>
 +
<tr><td>hda-diskmount</td>
 +
<td>Used to mount disk drives</td>
 +
</tr>
 +
<tr><td>hda-gems-install</td>
 +
<td>SYSTEM USE ONLY</td>
 +
</tr>
  
= Greyhole =
+
</table>
Use just "greyhole" in a Terminal to get the list, since those could change in the future. Currently, they are:
 
  
  Usage: greyhole [ACTION] [OPTIONS]
+
= Miscellaneous =
 
+
<table border="1">
  Where ACTION is one of:
+
<tr>
    -?, --help            Display this help and exit.
+
<th>Command</th>
    -D, --daemon          Start the daemon.
+
<th>Action</th>
    -f, --fsck            Schedule a fsck.
+
</tr>
    -l, --balance        Balance available space on storage pool devices.
+
<tr>
    -s, --stats          Display storage pool statistics.
+
<td>e2fsck -c /dev/sdb1</td>
    -S, --status          Display what the Greyhole daemon is currently doing.
+
<td>Check hard drive sdb1 for errors</td>
    -q, --view-queue      Display the current work queue.
+
</tr>
    -a, --empty-attic    Empty the attic.
+
<tr>
    -b, --debug=filename  Debug past file operations.
+
<td>​nscd -i hosts</td>
    -p, --prerotate      Pre-rotate task (for logrotate).
+
<td>Clear DNS cache on HDA</td>
    -P, --postrotate      Post-rotate task (for logrotate).
+
</tr>
    -t, --thaw[=path]    Thaw a frozen directory. Greyhole will start working on
+
<tr>
                          files inside <path>. If you don't supply an option, the list
+
<td>[[Application_Install_Scripts#The amahi-download utility script|​amahi-download]]</td>
                          of frozen directories will be displayed.
+
<td>similar to wget, but uses SHA1</td>
    -w, --wait-for[=path] Tell Greyhole that the missing drive at <path> will return
+
</tr>
                          soon, and that it shouldn't re-create additional file copies
+
</table><br />
                          to replace it. If you don't supply an option, the available
 
                          options (paths) will be displayed.
 
    -g, --gone[=path]    Tell Greyhole that the missing drive at <path> is gone for
 
                          good. Greyhole will start replacing the missing file copies
 
                          instantly. If you don't supply an option, the available
 
                          options (paths) will be displayed.
 
    -n, --going[=path]    Tell Greyhole that you want to remove a drive. Greyhole will
 
                          then make sure you don't loose any files, and that the
 
                          correct number of file copies are created to replace the
 
                          missing drive. If you don't supply an option, the available
 
                          options (paths) will be displayed.
 
 
 
  For --fsck, the available OPTIONS are:
 
    -e, --email-report    Send an email when fsck completes, to report on what was
 
                          checked, and any error that was found.
 
    -y, --dont-walk-graveyard
 
                          Speed up fsck by skipping the scan of the graveyard
 
                          directories. Scanning the graveyards is only required to
 
                          re-create symbolic links that might be missing from your
 
                          shared directories.
 
    -c, --if-conf-changed Only fsck if greyhole.conf changed since the last fsck.
 
                          Used in the daily cron to prevent unneccesary fsck runs.
 
    -d, --dir=path        Only scan a specific directory, and all sub-directories.
 
                          The specified directory should be a Samba share, or a
 
                          sub-directory of a Samba share.
 

Latest revision as of 01:24, 18 June 2017

Linux Basic Commands

Linux Basic Commands most users will need.

General Linux/HDA Commands

Fedora (root user)

Command Action
systemctl restart httpd.service restart web server
dnf -y update automatically update Fedora
rpm -q hda-platform check to see what version of HDA you're running


Ubuntu (precede with sudo)

Command Action
service apache2 restart restart web server
apt-get -y upgrade automatically update Ubuntu


HDA Script Commands

NOTE: Must be run from the /var/hda/platform/html/script directory.

Command Action
first-admin returns name of first admin user
reset-user-password reset a forgotten user password


NOTE: Can be run from anywhere (located in /usr/bin).

Command Action
hda-change-gw change gateway/router IP address
hda-change-dns change DNS provider for HDA
hda-install-gem install a specific Ruby Gem
hda-create-db-and-user create MariaDB user and database
hda-new-install DEPRECATED
hda-php-zone-change change time zone
hda-refresh-shares refresh HDA shares
hda-alias SYSTEM USE ONLY
hda-fix-sudoers SYSTEM USE ONLY
hda-install Amahi 7 or greater ONLY
hda-install-file SYSTEM USE ONLY
hda-register-apps SYSTEM USE ONLY
hda-settings Dumps current settings
hda-update-webapps SYSTEM USE ONLY
hda-add-apache-sudoers SYSTEM USE ONLY
hda-diskmount Used to mount disk drives
hda-gems-install SYSTEM USE ONLY

Miscellaneous

Command Action
e2fsck -c /dev/sdb1 Check hard drive sdb1 for errors
​nscd -i hosts Clear DNS cache on HDA
​amahi-download similar to wget, but uses SHA1