Operating System - HP-UX
1834090 Members
1916 Online
110063 Solutions
New Discussion

Re: Backup processing during removing user account thru SAM

 
Ngoh Chean Siung
Super Advisor

Backup processing during removing user account thru SAM

Hi,

I open 2 client terminals. One is used to remove user account thru SAM and the other one is used to check the backup process during removing user account.

When I grep the tty that removing the user account, below is what I have found:

root 15434 15433 182 11:07:39 pts/tj 0:07 /usr/bin/find / ! -fstype nfs -only ! -path /export/private_
root 15286 15281 0 11:07:08 pts/tj 0:01 samx -K 15285 /usr/sam/lib/%L/fal.ui
root 15433 1 0 11:07:39 pts/tj 0:00 /usr/bin/xargs /usr/bin/chacl -d 137.*
root 15281 14882 0 11:07:08 pts/tj 0:00 /usr/bin/sh /usr/sbin/sam
root 14881 594 0 11:02:13 pts/tj 0:00 telnetd
root 15411 15286 0 11:07:21 pts/tj 0:00 sh -c LANG=C LC_ALL=C /usr/sam/lbin/samx -C -p 15286 -s user
root 14882 14881 0 11:02:13 pts/tj 0:00 -sh
root 15436 1 73 11:07:39 pts/tj 0:04 /usr/bin/find / ! -fstype nfs ! -path /export/private_roots/
root 15412 15411 0 11:07:21 pts/tj 0:03 /usr/sam/lbin/samx -C -p 15286 -s users /usr/sam/lib/%L/ug.u

1) Why the system uses command "samx" and not "userdel" to remove the user account? I try to man samx but no manual for this command. Currently I am writting a script to remove user account but not able to log the activity into /var/sam/sam_remove.log by using command "userdel".

regards.
4 REPLIES 4
Steven E. Protter
Exalted Contributor

Re: Backup processing during removing user account thru SAM

samx is part of sam

I think it means sam execute.

If you look at the command logs in sam you will see the userdel or the sam version of userdel run.

sam has logs of commands. Helps you lean the command line and wean yourself from sam.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Ivajlo Yanakiev
Respected Contributor

Re: Backup processing during removing user account thru SAM

SAM use many bin files and command to do its job. You are correct that there aren't any man.
samx is hpux only command. userdel and useradd are unix wide use command they are standart :)
Use userdel in your scripts. Why you need log in var/sam/sam_remove.log ?
You can create your log file.
Ngoh Chean Siung
Super Advisor

Re: Backup processing during removing user account thru SAM

Hi,

Is it possible to log the same info as /var/sam/sam_remove.log into another log file?

I hv attached my script. Any ideas?

regards.
Ivajlo Yanakiev
Respected Contributor

Re: Backup processing during removing user account thru SAM

I realy do not like taht one:
echo "Press [Y]/[y] to continue, [Enter] to quit \c"
read ans rest
if [ -z "$ans" ]
then
exit
fi
echo ""

If user just press any key but not ENTER
user will be del.
Check user input and delete only if there y/Y

use userdel -r instead /usr/sam/lbin/userdel.sam
Also if you need del all $userid files
use find -user $userid

look link:
http://cis.stvincent.edu/carlsond/cs330/unix/advanced/userdel