OpenIndiana

From Hack Sphere Labs Wiki
Revision as of 23:51, 2 September 2013 by Webdawg (talk | contribs) (managing services)

Jump to: navigation, search

managing services

  • list broken services
 svcs -a
  • delete service
svccfg delete smartd
  • status service
svcs smartd

smart monitoring

pfexec pkg set-publisher -p http://pkg.openindiana.org/sfe
pfexec pkg install storage/smartmontools

Example Smart Query Command (sata)

smartctl -a /dev/rdsk/c3t2d0 -d sat,12

Monitor Drives

nano -w /etc/smartd.conf
#DEVICESCAN
#eh drives  
/dev/rdsk/c3t0d0 -d sat,12 -a -o on -S on -s (S/../.././04|L/../../7/03)
/dev/rdsk/c3t1d0 -d sat,12 -a -o on -S on -s (S/../.././04|L/../../7/03)
/dev/rdsk/c3t2d0 -d sat,12 -a -o on -S on -s (S/../.././04|L/../../7/03)
/dev/rdsk/c3t3d0 -d sat,12 -a -o on -S on -s (S/../.././04|L/../../7/03)
#os drives
/dev/rdsk/c3t4d0s0 -d sat,12 -a -o on -S on -s (S/../.././04|L/../../7/03)
/dev/rdsk/c3t5d0s0 -d sat,12 -a -o on -S on -s (S/../.././04|L/../../7/03)
pfexec smartd -q onecheck
sudo nano -w /var/svc/manifest/site/smartd.xml

<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type="manifest" name="smartd">
  <service
     name="site/smartd"
     type="service"
     version="1">
    <single_instance/>
    <dependency
       name="filesystem-local"
       grouping="require_all"
       restart_on="none"
       type="service">
      <service_fmri value="svc:/system/filesystem/local:default"/>
    </dependency>
    <exec_method
       type="method"
       name="start"
       exec="/usr/sbin/smartd start"
       timeout_seconds="60">
      <method_context>
        <method_credential user="root" group="root"/>
      </method_context>
    </exec_method>
    <exec_method
       type="method"
       name="stop"
       exec="/usr/sbin/smartd stop"
       timeout_seconds="60">
    </exec_method>
    <instance name="default" enabled="true"/>
    <stability value="Unstable"/>
    <template>
      <common_name>
        <loctext xml:lang="C">
          SMART monitoring service (smartd)
        </loctext>
      </common_name>
      <documentation>
        <manpage title="smartd" section="1M" manpath="/usr/local/share/man"/>
      </documentation>
    </template>
  </service>
</service_bundle>
pfexec svccfg -v import /var/svc/manifest/site/smartd.xml
svcs smartd

If not on:

pfexec svcadm enable smartd

Date and Time

Timezone

tzselect
  • Take value learned
nano -w /etc/default/init
  • Set TZ=US/Eastern

You should reboot the system as all child processes take value from that file/data.

ntp client

cp /etc/inet/ntp.client /etc/inet/ntp.conf
nano -w /etc/inet/ntp.conf
  • Add some servers or whatever:
server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org
  • enable and restart ntpd
svcadm enable svc:/network/ntp:default
svcadm restart svc:/network/ntp:default
  • check to see if it is running
svcs -a | grep ntp
  • query ntp server
ntpq -p

Creating Static IP

# nwamcfg
nwamcfg> create ncp Nickebo
nwamcfg:ncp:Nickebo> create ncu phys e1000g0
Created ncu 'e1000g0'.  Walking properties ...
activation-mode (manual) [manual|prioritized]> prioritized
enabled (true) [true|false]>
priority-group> 0
priority-mode [exclusive|shared|all]> shared
link-mac-addr>
link-autopush>
link-mtu>
nwamcfg:ncp:Nickebo:ncu:e1000g0> end
Committed changes
nwamcfg:ncp:Nickebo> create ncu ip e1000g0
Created ncu 'e1000g0'.  Walking properties ...
enabled (true) [true|false]>
ip-version (ipv4,ipv6) [ipv4|ipv6]>
ipv4-addrsrc (dhcp) [dhcp|static]> static
ipv4-addr> 172.16.0.21
ipv4-default-route> 172.16.0.1
ipv6-addrsrc (dhcp,autoconf) [dhcp|autoconf|static]> dhcp,autoconf,static
ipv6-addr> 2001:470:df83::21
ipv6-default-route> 2001:470:df83::1
nwamcfg:ncp:Nickebo:ncu:e1000g0> end
Committed changes
nwamcfg:ncp:Nickebo> end
# nwamadm enable -p ncp Nickebo
Enabling ncp 'Nickebo'
  • Also:

Repos

http://wiki.openindiana.org/oi/Spec+Files+Extra+Repository

The SFE package repository is an "extras" package repository, supplementing the core OI distribution with additional software from the Spec Files Extra project.

It contains a wide variety of software, including:

  • Various languages and compilers (gcc 4.6.2, Steel Bank Common Lisp, the Glasgow Haskell Compiler, Python 3
  • Various daemons and database programs (PostgreSQL, dovecot, postfix)
  • Qt 4.7 and some applications which use it (the Scribus desktop publishing system, the LyX LaTeX front end, the Arora Web browser)
  • Multimedia applications (Music Player Daemon and several clients, FFmpeg, mplayer2, vlc, MKVToolnix)

Notes


Commands

http://wiki.openindiana.org/oi/pkg+Cheat+Sheet

Upgrading

If you are currently running OpenIndiana oi_147 or oi_148, first, verify you have the correct publishers set:

pfexec pkg publisher

PUBLISHER TYPE STATUS URI openindiana.org (preferred) origin online http://pkg.openindiana.org/dev/

If your openindiana.org publisher is set to a different URI, for example http://pkg.openindiana.org/dev-il/ (our release candidate branch), you can correct this with:

pfexec pkg set-publisher -O http://pkg.openindiana.org/dev/ openindiana.org

opensolaris.org publisher If you currently have the opensolaris.org publisher set, we would highly recommend unsetting it by running:

pfexec pkg unset-publisher opensolaris.org

Make sure pkg is up to date:

pfexec pkg install package/pkg

You can now identify what will be upgraded by issuing the command:

pfexec pkg image-update -nv

The -n flag specifies to perform no action (i.e. perform a trial run), and the -v flag is the verbose option, to provide additional output.

I always do big upgrades in screen so:

screen

If you are satisfied with the actions to be taken, you can perform the upgrade by typing:

pfexec pkg image-update -v

You may want to consider also passing the "--be-name" flag to give the new boot environment created a more memorable name, such as oi_151a.

Note: You may want to upgrade your zpool if you have a new version of ZFS

References

Interesting

Notes