This post is in complement to the SMF interface post.
Here are a few examples for the svcs command.
Online services ordered by FMRI (Fault Management Resource Identifier):
# svcs | sort -t / -k 2 | tail
online Jan_24 svc:/system/svc/restarter:default
online Jan_24 svc:/system/sysevent:default
online Jan_24 svc:/system/system-log:default
online Jan_24 svc:/system/timezone:default
...
online Jan_24 svc:/system/zones-install:default
online Jan_24 svc:/system/zones-monitoring:default
online Jan_24 svc:/system/zones:default
The state of the ssh service and PIDs for all currently associated processes:
$ svcs -p ssh
STATE STIME FMRI
online Jan_23 svc:/network/ssh:default
Jan_23 937 sshd
Other services upon which the ssh service depends:
(note that ipfilter is disabled; it's an optional dependency)
$ svcs -d ssh
STATE STIME FMRI
disabled Jan_23 svc:/network/ipfilter:default
online Jan_23 svc:/network/loopback:default
online Jan_23 svc:/system/cryptosvc:default
online Jan_23 svc:/system/utmp:default
online Jan_23 svc:/network/physical:default
online Jan_23 svc:/system/filesystem/local:default
online Jan_23 svc:/system/filesystem/autofs:default
Other services that depend on ssh service:
$ svcs -D ssh
STATE STIME FMRI
online Jan_23 svc:/milestone/self-assembly-complete:default
online Jan_23 svc:/milestone/multi-user-server:default
The ssh service's profile, manifest and log:
$ svcs -l ssh | egrep '(log|manifest)'
logfile /var/svc/log/network-ssh:default.log
manifest /etc/svc/profile/generic.xml
manifest /lib/svc/manifest/network/ssh.xml
$ svcs -n ssh
Notification parameters for FMA Events
Event: problem-diagnosed
Notification Type: smtp
Active: true
reply-to: root@localhost
to: root@localhost
Notification Type: snmp
Active: true
Notification Type: syslog
Active: true
Event: problem-repaired
Notification Type: snmp
Active: true
Event: problem-resolved
Notification Type: snmp
Active: true
Personal notes and recipes, views and opinions.
If it must run, it runs on Solaris!
Wednesday, January 29, 2014
SMF interface
The SMF interface is comprised of management and configuration commands.
The management CLI commands are:
The configuration CLI commands are:
The management CLI commands are:
- svcs
Prints summary information.
For instance: state, dependencies, log, notifications and processes.
Examples.
- svcadm
Manipulates instances.
Requests actions to the associated service restarter.
For instance: enable, disable, refresh, restart, clear.
Examples.
The configuration CLI commands are:
- svcprop
Prints properties values.
It can take into account the different repository layers.
Examples.
- svccfg
Manipulates configuration data on the repository.
It also provides helpers for importing, exporting, validation, and so on.
Examples.
SMF overview
As you probably might know SMF stands for Service Management Facility.
It's an evolution to the now obsolete initialization and termination scripts.
Thus SMF replaces init.d and rc?.d scripts as depicted on init.d(4).
The ? on rc?.d corresponds to the init states as depicted on init(1M).
But SMF is actually more than just an interface for services management:
After understanding all the advantages of SMF its adoption is quite obvious.
There are excellent how-to articles at Oracle website, such as:
Nevertheless, I'd like to add a few notes and summaries.
I think that my effort can add more help in getting acquainted to SMF.
Here's my SMF post list:
It's an evolution to the now obsolete initialization and termination scripts.
Thus SMF replaces init.d and rc?.d scripts as depicted on init.d(4).
The ? on rc?.d corresponds to the init states as depicted on init(1M).
But SMF is actually more than just an interface for services management:
- It's part of FMA (Fault Management Architecture).
This means it automatically restarts services as possible.
It can notify via SNMP or SMTP on services' state changes.
- It's also a repository of services' properties replacing configuration files.
This is probably the major impact to system administrators.
- Service interdependency documentation.
This means better management and faster troubleshooting.
- Parallel initialization.
This means the system can start way much faster.
After understanding all the advantages of SMF its adoption is quite obvious.
There are excellent how-to articles at Oracle website, such as:
- Introducing the the Basics of SMF
- Advanced Administration with the SMF
- Using svcbundle to Create SMF Manifest and Profiles
- Migrate Control of System Services from Scripts to the SMF
Nevertheless, I'd like to add a few notes and summaries.
I think that my effort can add more help in getting acquainted to SMF.
Here's my SMF post list:
Thursday, January 23, 2014
Xscreensaver unlock picture
Beyond the security & consent banner, one nice touch for a personal desktop installation is the customization of the Xscreensaver unlock picture. It's a JPEG image, possibly a square around 237 pixels in side.
# cd /usr/lib/xscreensaver/config
# cp -p unlock-logo{,-original}.png
# cp /tmp/unlock-logo-new.jpg .
# cp unlokck-logo{-new.jpg,.png}
NOTE
The result is something similar to:
# cd /usr/lib/xscreensaver/config
# cp -p unlock-logo{,-original}.png
# cp /tmp/unlock-logo-new.jpg .
# cp unlokck-logo{-new.jpg,.png}
NOTE
Yes, weird!
It's a JPEG image with a .PNG extension!
The result is something similar to:
Wednesday, January 22, 2014
Mercurial help
After Mercurial installation one may need to browse some help.
But, above all, it's paramount to read:
The CLI consists on a long list of hg subcommands:
# hg -v help
Mercurial Distributed SCM
list of commands:
add:
add the specified files on the next commit
addremove:
add all new files, delete all missing files
annotate, blame:
show changeset information by line for each file
archive:
create an unversioned archive of a repository revision
backout:
reverse effect of earlier changeset
bisect:
subdivision search of changesets
bookmarks:
track a line of development with movable markers
branch:
set or show the current branch name
branches:
list repository named branches
bundle:
create a changegroup file
cat:
output the current or given revision of files
clone:
make a copy of an existing repository
commit, ci:
commit the specified files or all outstanding changes
copy, cp:
mark files as copied for the next commit
diff:
diff repository (or selected files)
export:
dump the header and diffs for one or more changesets
forget:
forget the specified files on the next commit
graft:
copy changes from other branches onto the current branch
grep:
search for a pattern in specified files and revisions
heads:
show current repository heads or show branch heads
help:
show help for a given topic or a help overview
identify, id:
identify the working copy or specified revision
import, patch:
import an ordered set of patches
incoming, in:
show new changesets found in source
init:
create a new repository in the given directory
locate:
locate files matching specific patterns
log, history:
show revision history of entire repository or files
manifest:
output the current or given revision of the project manifest
merge:
merge working directory with another revision
outgoing, out:
show changesets not found in the destination
parents:
show the parents of the working directory or revision
paths:
show aliases for remote repositories
phase:
set or show the current phase name
pull:
pull changes from the specified source
push:
push changes to the specified destination
recover:
roll back an interrupted transaction
remove, rm:
remove the specified files on the next commit
rename, move, mv:
rename files; equivalent of copy + remove
resolve:
redo merges or set/view the merge status of files
revert:
restore files to their checkout state
rollback:
roll back the last transaction (dangerous)
root:
print the root (top) of the current working directory
serve:
start stand-alone webserver
showconfig, debugconfig:
show combined config settings from all hgrc files
status, st:
show changed files in the working directory
summary, sum:
summarize working directory state
tag:
add one or more tags for the current or given revision
tags:
list repository tags
tip:
show the tip revision
unbundle:
apply one or more changegroup files
update, up, checkout, co:
update working directory (or switch revisions)
verify:
verify the integrity of the repository
version:
output version and copyright information
additional help topics:
config Configuration Files
dates Date Formats
diffs Diff Formats
environment Environment Variables
extensions Using Additional Features
filesets Specifying File Sets
glossary Glossary
hgignore Syntax for Mercurial Ignore Files
hgweb Configuring hgweb
merge-tools Merge Tools
multirevs Specifying Multiple Revisions
patterns File Name Patterns
phases Working with Phases
revisions Specifying Single Revisions
revsets Specifying Revision Sets
subrepos Subrepositories
templating Template Usage
urls URL Paths
global options:
-R --repository REPO repository root directory or
name of overlay bundle file
--cwd DIR change working directory
-y --noninteractive do not prompt, automatically
pick the first choice for
all prompts
-q --quiet suppress output
-v --verbose enable additional output
--config CONFIG [+] set/override config option
(use 'section.name=value')
--debug enable debugging output
--debugger start debugger
--encoding ENCODE set the charset encoding
(default: UTF-8)
--encodingmode MODE set the charset encoding mode
(default: strict)
--traceback always print a traceback on exception
--time time how long the command takes
--profile print command execution profile
--version output version information and exit
-h --help display help and exit
[+] marked option can be specified multiple times
Of course man pages are available at HG(1).
For instance:
$ man hg
Mercurial Manual HG(1)
NAME
hg - Mercurial source code management system
SYNOPSIS
hg command [option]... [argument]...
DESCRIPTION
The hg command provides a command line
interface to the Mercurial system.
COMMAND ELEMENTS
...
OPTIONS
...
In addition there's a quick and cool HTTP option.
All that's required is to create an empty repository and start the server.
# cd /var/tmp
# hg init sample
# hg serve -d -p 8000 -R sample -A /tmp/access -E /tmp/error
Assume that the previous commands were given at the mercurial host.
Just point a web browser to http://mercurial:8000/help to get started.
The access log will immediately starting tracking activity.
# cat /tmp/access
192.168.0.100 ... "GET /help HTTP/1.1" 200 -
192.168.0.100 ... "GET /static/mercurial.js HTTP/1.1" 304 -
192.168.0.100 ... "GET /static/style-paper.css HTTP/1.1" 304 -
192.168.0.100 ... "GET /static/hgicon.png HTTP/1.1" 304 -
192.168.0.100 ... "GET /static/hglogo.png HTTP/1.1" 304 -
To stop the web server:
# pgrep -f 'hg serve -d -p 8000'
16737
# pkill -f 'hg serve -d -p 8000'
But, above all, it's paramount to read:
- Mercurial: The Definitive Guide (HTML)
- Mercurial: The Definitive Guide (Documentation)
The CLI consists on a long list of hg subcommands:
# hg -v help
Mercurial Distributed SCM
list of commands:
add:
add the specified files on the next commit
addremove:
add all new files, delete all missing files
annotate, blame:
show changeset information by line for each file
archive:
create an unversioned archive of a repository revision
backout:
reverse effect of earlier changeset
bisect:
subdivision search of changesets
bookmarks:
track a line of development with movable markers
branch:
set or show the current branch name
branches:
list repository named branches
bundle:
create a changegroup file
cat:
output the current or given revision of files
clone:
make a copy of an existing repository
commit, ci:
commit the specified files or all outstanding changes
copy, cp:
mark files as copied for the next commit
diff:
diff repository (or selected files)
export:
dump the header and diffs for one or more changesets
forget:
forget the specified files on the next commit
graft:
copy changes from other branches onto the current branch
grep:
search for a pattern in specified files and revisions
heads:
show current repository heads or show branch heads
help:
show help for a given topic or a help overview
identify, id:
identify the working copy or specified revision
import, patch:
import an ordered set of patches
incoming, in:
show new changesets found in source
init:
create a new repository in the given directory
locate:
locate files matching specific patterns
log, history:
show revision history of entire repository or files
manifest:
output the current or given revision of the project manifest
merge:
merge working directory with another revision
outgoing, out:
show changesets not found in the destination
parents:
show the parents of the working directory or revision
paths:
show aliases for remote repositories
phase:
set or show the current phase name
pull:
pull changes from the specified source
push:
push changes to the specified destination
recover:
roll back an interrupted transaction
remove, rm:
remove the specified files on the next commit
rename, move, mv:
rename files; equivalent of copy + remove
resolve:
redo merges or set/view the merge status of files
revert:
restore files to their checkout state
rollback:
roll back the last transaction (dangerous)
root:
print the root (top) of the current working directory
serve:
start stand-alone webserver
showconfig, debugconfig:
show combined config settings from all hgrc files
status, st:
show changed files in the working directory
summary, sum:
summarize working directory state
tag:
add one or more tags for the current or given revision
tags:
list repository tags
tip:
show the tip revision
unbundle:
apply one or more changegroup files
update, up, checkout, co:
update working directory (or switch revisions)
verify:
verify the integrity of the repository
version:
output version and copyright information
additional help topics:
config Configuration Files
dates Date Formats
diffs Diff Formats
environment Environment Variables
extensions Using Additional Features
filesets Specifying File Sets
glossary Glossary
hgignore Syntax for Mercurial Ignore Files
hgweb Configuring hgweb
merge-tools Merge Tools
multirevs Specifying Multiple Revisions
patterns File Name Patterns
phases Working with Phases
revisions Specifying Single Revisions
revsets Specifying Revision Sets
subrepos Subrepositories
templating Template Usage
urls URL Paths
global options:
-R --repository REPO repository root directory or
name of overlay bundle file
--cwd DIR change working directory
-y --noninteractive do not prompt, automatically
pick the first choice for
all prompts
-q --quiet suppress output
-v --verbose enable additional output
--config CONFIG [+] set/override config option
(use 'section.name=value')
--debug enable debugging output
--debugger start debugger
--encoding ENCODE set the charset encoding
(default: UTF-8)
--encodingmode MODE set the charset encoding mode
(default: strict)
--traceback always print a traceback on exception
--time time how long the command takes
--profile print command execution profile
--version output version information and exit
-h --help display help and exit
[+] marked option can be specified multiple times
Of course man pages are available at HG(1).
For instance:
$ man hg
Mercurial Manual HG(1)
NAME
hg - Mercurial source code management system
SYNOPSIS
hg command [option]... [argument]...
DESCRIPTION
The hg command provides a command line
interface to the Mercurial system.
COMMAND ELEMENTS
...
OPTIONS
...
In addition there's a quick and cool HTTP option.
All that's required is to create an empty repository and start the server.
# cd /var/tmp
# hg init sample
# hg serve -d -p 8000 -R sample -A /tmp/access -E /tmp/error
Assume that the previous commands were given at the mercurial host.
Just point a web browser to http://mercurial:8000/help to get started.
The access log will immediately starting tracking activity.
# cat /tmp/access
192.168.0.100 ... "GET /help HTTP/1.1" 200 -
192.168.0.100 ... "GET /static/mercurial.js HTTP/1.1" 304 -
192.168.0.100 ... "GET /static/style-paper.css HTTP/1.1" 304 -
192.168.0.100 ... "GET /static/hgicon.png HTTP/1.1" 304 -
192.168.0.100 ... "GET /static/hglogo.png HTTP/1.1" 304 -
To stop the web server:
# pgrep -f 'hg serve -d -p 8000'
16737
# pkill -f 'hg serve -d -p 8000'
Subscribe to:
Posts (Atom)

