Author Archives: admin

Service to pid and vice versa

In Solaris 10 widely used concept of “service”.
Each service can start some daemons, but information, what service start this or that daemon sometimes isn’t obvious.
In Solaris 10 each process has new field :ctid – contract ID of the process.
so, ps -ef -o pid,ctid,comm will show you contract ID for all processes.
And
svcs -a -o FMRI,CTID – about Contract ID for each service.
Now you can find all processes, for ftp service, for example :

ps -ef -o pid,ctid,comm |grep `svcprop -p restarter/contract svc:/network/ftp:default`

suid script

In solaris ( all other Unix’es too?) most script interpretators will ignore suid bit, and the effective user id is set to the real user id. To avoid this you can use specific options. For example -p for ksh and bash.

size of automaped dir

I founded this interesting behaviour then trying to collect Explorer by nfs.
If you want to know size of automounted filesystem you can see unexpected results:

root@serv # df -h /net/hostname/sharename
Filesystem size used avail capacity Mounted on
-hosts 0K 0K 0K 0% /net/hostname/sharename

but if you do:

root@serv # df -h /net/hostname/sharename/.
Filesystem size used avail capacity Mounted on
hostname:/sharename 128G 75G 53G 59% /net/hostname/sharename