Operating System - HP-UX
1834665 Members
2567 Online
110069 Solutions
New Discussion

Please Help: All sw* commands show error Not Owner

 
SOLVED
Go to solution
stalucia
Advisor

Please Help: All sw* commands show error Not Owner


I'm not able to run any sw command like swlist, swinstall etc etc as root, it gives me the error "Not Owner"...
# id
uid=0(root) gid=3(sys) groups=0(root),1(other),2(bin),4(adm),5(daemon),6(mail),7(lp),20(users),100(informix),201(dessiis)

# /usr/sbin/swlist
bash: /usr/sbin/swlist: Not owner

# ls -la /usr/sbin/sw*
-rwsr-sr-x 11 root bin 6057568 Mar 26 2007 /usr/sbin/swacl
-r-sr-xr-x 1 bin bin 2016208 Mar 26 2007 /usr/sbin/swagentd
-r-sr-xr-x 1 bin bin 35180 Mar 26 2004 /usr/sbin/swapinfo
-r-sr-xr-x 1 bin bin 73060 May 30 2005 /usr/sbin/swapon
-rwsr-sr-x 11 root bin 6057568 Mar 26 2007 /usr/sbin/swask
-rwsr-sr-x 11 root bin 6057568 Mar 26 2007 /usr/sbin/swconfig
-rwsr-sr-x 11 root bin 6057568 Mar 26 2007 /usr/sbin/swcopy
-rwsr-sr-x 11 root bin 6057568 Mar 26 2007 /usr/sbin/swinstall
-rwsr-sr-x 11 root bin 6057568 Mar 26 2007 /usr/sbin/swjob
-rwsr-sr-x 11 root bin 6057568 Mar 26 2007 /usr/sbin/swlist
-r-sr-xr-x 2 root bin 3998728 Mar 26 2007 /usr/sbin/swmodify
-r-sr-xr-x 2 root bin 3998728 Mar 26 2007 /usr/sbin/swpackage
-rwsr-sr-x 11 root bin 6057568 Mar 26 2007 /usr/sbin/swreg
-rwsr-sr-x 11 root bin 6057568 Mar 26 2007 /usr/sbin/swremove
-rwsr-sr-x 11 root bin 6057568 Mar 26 2007 /usr/sbin/swverify

What's the problem???
24 REPLIES 24
Uday_S_Ankolekar
Honored Contributor

Re: Please Help: All sw* commands show error Not Owner

Did you try stop and restart swagent?

/usr/sbin/swagent -k to stop and -r to restart

you can also try /sbin/init.d/swagent stop |start

-USA
Good Luck..
Steven E. Protter
Exalted Contributor

Re: Please Help: All sw* commands show error Not Owner

Shalom,

The problem is not ownership.

Its either as noted swagentd or /etc/nsswitch.conf is missing or misconfigured.

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
TTr
Honored Contributor

Re: Please Help: All sw* commands show error Not Owner

Is this on HP-UX? Can you try with the standard shell for root /sbin/sh and with a direct login to root?
Google shows many hits on this, all with bash. None of the ones I looked had a clear answer though.
Bob E Campbell
Honored Contributor

Re: Please Help: All sw* commands show error Not Owner

Just deleted a long response, short version is:

1. Did you replaces /sbin/sh with bash?

2. Did you define a rootb user or change the root user shell?

3. If you did neither, what happens when you run the command "/sbin/sh exec swlist"
stalucia
Advisor

Re: Please Help: All sw* commands show error Not Owner

Hello, thanks for reply but nothing seems to work :-s

I changed the owner of swagent from bin to root so i was able to restart it but still getting the same error... tried with /sbin/sh:

/sbin/sh exec swlist
/sbin/sh: swlist: Execute permission denied.

anything else i should try?


cat /etc/nsswitch.conf
#
# /etc/nsswitch.compat:
#
# @(#)B11.23_LR
#
# An example file that could be copied over to /etc/nsswitch.conf; it
# uses NIS (YP) in conjunction with files.
#

passwd: files
group: files
hosts: files dns
ipnodes: files
networks: files
protocols: files
rpc: files
publickey: files
netgroup: files
automount: files
aliases: files
services: files
Dennis Handly
Acclaimed Contributor

Re: Please Help: All sw* commands show error Not Owner

>/sbin/sh: swlist: Execute permission denied.

Could you have changed the permissions on the shlibs that swlist needs?
$ chatr /usr/sbin/swlist
/usr/sbin/swlist:
32-bit ELF executable
shared library list:
libpthread.so.1
libdcekt.so.1
libc.so.1
libobam.so.1
libm.so.1
Look at these.
What does this show: ldd /usr/sbin/swlist
Bob E Campbell
Honored Contributor

Re: Please Help: All sw* commands show error Not Owner

I have a feeling most of the commands I would ask you to run would not work (notice the link counts in your listing). I think that Dennis is on to something as your commands are OK and it fails in a standard shell.

Can you tell us how much customization was done on the system? Look in the file /var/adm/sw/swagent.log for the must recent "successful" job and then try and remember what was modified since then.

If you have a second HP-UX system that is well behaved, try the command:

# swlist @ systemWithAProblem

Tingli
Esteemed Contributor

Re: Please Help: All sw* commands show error Not Owner

How about restart /usr/sbin/swagentd -r?
stalucia
Advisor

Re: Please Help: All sw* commands show error Not Owner


Dennis,

# chatr /usr/sbin/swlist
/usr/sbin/swlist:
32-bit ELF executable
shared library dynamic path search:
LD_LIBRARY_PATH disabled second
SHLIB_PATH disabled third
embedded path enabled first /var/adm/sw/lib:/usr/lib/sw/lib:/usr/obam/lib::
shared library list:
libpthread.so.1
libdcekt.so.1
libc.so.1
libobam.so.1
libm.so.1
shared library binding:
immediate nonfatal
global hash table disabled
shared library mapped private disabled
mem_check value disabled
shared library segment merging disabled
shared vtable support disabled
explicit unloading disabled
linkage table protection disabled
segments:
index type address flags size
5 text 04000000 z---c- D (default)
6 data 40000000 ---m-- D (default)
executable from stack: D (default)
kernel assisted branch prediction enabled
lazy swap allocation for dynamic segments disabled
nulptr dereferences trap enabled
caliper dynamic instrumentation disabled


I compared the results with another system well behaved and the path/permissions of shared libraries seems to be ok.


# ldd /usr/sbin/swlist
ldd: Cannot execute "/usr/sbin/swlist", Not owner.


Dennis Handly
Acclaimed Contributor

Re: Please Help: All sw* commands show error Not Owner

>I compared the results with another system well behaved and the path/permissions of shared libraries seems to be ok.

You check the path all the way back to "/"?
(I assume swverify doesn't work too? )-:

# ldd /usr/sbin/swlist
ldd: Cannot execute "/usr/sbin/swlist", Not owner.

This indicates something is wrong with swlist, or any of those shlibs.

Can you check the ownership of swapinfo and swapon on both machines.
-r-sr-xr-x bin bin /usr/sbin/swapinfo
-r-sr-xr-x bin bin /usr/sbin/swapon

Having setuid to bin doesn't seem all that useful.
Bob E Campbell
Honored Contributor

Re: Please Help: All sw* commands show error Not Owner

OK, lets look at this another way. Is your IPD OK? Run the command:

# ls -la /var/adm/sw

If that looks clean I really hope that there is something non-standard about your system security or file systems...
Dennis Handly
Acclaimed Contributor
Solution

Re: Please Help: All sw* commands show error Not Owner

This thread has a bunch of scripts I wrote so that you can restore ownership and permissions from a known good system if swverify won't work:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1215123
stalucia
Advisor

Re: Please Help: All sw* commands show error Not Owner

Hello all,

Dennis, swverify doesn't work either...

I changed permissions on /usr/sbin/sw*, now it is as my other servers:

ls -la /usr/sbin/sw*
-r-sr-xr-x 11 root bin 6057568 Mar 26 2007 /usr/sbin/swacl
-r-xr-xr-x 1 root bin 2016208 Mar 26 2007 /usr/sbin/swagentd
-r-xr-xr-x 1 root bin 35180 Mar 26 2004 /usr/sbin/swapinfo
-r-xr-xr-x 1 root bin 73060 May 30 2005 /usr/sbin/swapon
-r-sr-xr-x 11 root bin 6057568 Mar 26 2007 /usr/sbin/swask
-r-sr-xr-x 11 root bin 6057568 Mar 26 2007 /usr/sbin/swconfig
-r-sr-xr-x 11 root bin 6057568 Mar 26 2007 /usr/sbin/swcopy
-r-sr-xr-x 11 root bin 6057568 Mar 26 2007 /usr/sbin/swinstall
-r-sr-xr-x 11 root bin 6057568 Mar 26 2007 /usr/sbin/swjob
-r-sr-xr-x 11 root bin 6057568 Mar 26 2007 /usr/sbin/swlist
-r-sr-xr-x 2 root bin 3998728 Mar 26 2007 /usr/sbin/swmodify
-r-sr-xr-x 2 root bin 3998728 Mar 26 2007 /usr/sbin/swpackage
-r-sr-xr-x 11 root bin 6057568 Mar 26 2007 /usr/sbin/swreg
-r-sr-xr-x 11 root bin 6057568 Mar 26 2007 /usr/sbin/swremove
-r-sr-xr-x 11 root bin 6057568 Mar 26 2007 /usr/sbin/swverify

But it didn't make any effect :-s

I'm still getting the same error:

swlist
sh: swlist: Execute permission denied.


Please Help!
stalucia
Advisor

Re: Please Help: All sw* commands show error Not Owner


Dennis i tried your scripts but im not able to chmod any of the sw* files, same issue: not owner error :-s



chmod: can't change /usr/sbin/swacl: Permission denied
chmod: can't change /usr/sbin/swask: Permission denied
chmod: can't change /usr/sbin/swconfig: Permission denied
chmod: can't change /usr/sbin/swcopy: Permission denied
chmod: can't change /usr/sbin/swinstall: Permission denied
chmod: can't change /usr/sbin/swjob: Permission denied
chmod: can't change /usr/sbin/swlist: Permission denied
chmod: can't change /usr/sbin/swmodify: Permission denied
chmod: can't change /usr/sbin/swpackage: Permission denied
chmod: can't change /usr/sbin/swreg: Permission denied
chmod: can't change /usr/sbin/swremove: Permission denied
chmod: can't change /usr/sbin/swverify: Permission denied


I don't know what else to do... :-( sniff sniff
TTr
Honored Contributor

Re: Please Help: All sw* commands show error Not Owner

Along the lines of Dennis' questions, run and show us the output of the following

ll -d /
ll -d /usr
ll -d /etc
ll /etc/passwd
cat /etc/passwd (need to see root entry)
/usr/sbin/swapinfo (this is not hard linked)

Also, how do you login to the server? Is it a direct login to root or login to another account and su to root?
Dennis Handly
Acclaimed Contributor

Re: Please Help: All sw* commands show error Not Owner

>I tried your scripts but I'm not able to chmod any of the sw* files, same issue: not owner error:
chmod: can't change /usr/sbin/swacl: Permission denied

But you just got though saying you changed it successfully??

This is impossible! Are you root? What does "id" show?
You haven't put /usr on an NFS filesystem have you? Or mounted it with nosuid?

You may want to copy swlist to some other directory, change the permissions/ownership to match and then try running that using an absolute path.
stalucia
Advisor

Re: Please Help: All sw* commands show error Not Owner

Dennis, i did your suggestion and it worked, copied swlist to /root/swlist, executed it and it works from that path... something is happening under /usr/sbin/ :-s

ll -d /
drwxr-xr-x 29 root root 8192 Jul 3 14:49 /


ll -d /usr
dr-xr-xr-x 24 bin bin 8192 Feb 26 11:09 /usr


ll -d /usr/sbin
dr-xr-xr-x 7 bin bin 16384 Mar 27 11:39 /usr/sbin



grep root /etc/passwd
root:6ymmCLYFPYrKI:0:3::/root:/sbin/sh


id root
uid=0(root) gid=3(sys) groups=0(root),1(other),2(bin),4(adm),5(daemon),6(mail),7(lp),20(users),100(informix),201(dessiis)


grep /usr /etc/fstab
/dev/vg00/lvol7 /usr vxfs delaylog 0 2


P.D
Before, i was able to change permissions under /usr/sbin login in through console, otherwise im not able to chmod or chown under that path

Dennis Handly
Acclaimed Contributor

Re: Please Help: All sw* commands show error Not Owner

>I did your suggestion and it worked, copied swlist to /root/swlist, executed it and it works from that path... something is happening under /usr/sbin/

Or a cosmic ray hit memory and the image there is corrupted. That happens all the time if the executable is over NFS and the server side changed.

Try: ln -f /root/swlist /usr/sbin

Then try /usr/sbin/swlist.

drwxr-xr-x root root /
dr-xr-xr-x bin bin /usr
dr-xr-xr-x bin bin /usr/sbin

These seem fine. What about /usr/lib?

>I was able to change permissions under /usr/sbin login in through console, otherwise I'm not able to chmod or chown under that path

I'm confused, you are either root or you are not. Once you are root it shouldn't matter how you logged on.
Avinash20
Honored Contributor

Re: Please Help: All sw* commands show error Not Owner

All the above sw* commands belongs to
>> Software Distributor Cumulative Patch
>> Could you post the cksum value of any of the two command
> Do you have an old swlist output/ or nickel of the server to check the Software Distributor Cumulative Patch installed on the server ?
"Light travels faster than sound. That's why some people appear bright until you hear them speak."
stalucia
Advisor

Re: Please Help: All sw* commands show error Not Owner

Hello Dennis and Avinash,

>Try: ln -f /root/swlist /usr/sbin

# ln -f /root/swlist /usr/sbin/swlist
ln: different file system

/dev/vg00/lvol7 10289152 2812832 7417920 27% /usr
/dev/vg00/lvroot 262144 117669 135839 46% /root


>These seem fine. What about /usr/lib?

ls -ld /usr/lib/
dr-xr-xr-x 38 bin bin 16384 Apr 17 17:33 /usr/lib/

>> Could you post the cksum value of any of the two command

cksum /usr/sbin/swlist
1597149151 6057568 /usr/sbin/swlist

This is the same result that i get when executing the command on another machine.

> Do you have an old swlist output/ or nickel of the server to check the Software Distributor Cumulative Patch installed on the server ?

I don't have an old swlist output but this is the output from /root/swlist -l fileset :

# SW-DIST B.11.23.0706.063 HP-UX Software Distributor
SW-DIST.GZIP B.11.23.0706.063 Gnu gzip Architecture-independent Tools
SW-DIST.GZIP2 B.11.23.0706.063 Gnu gzip Architecture-dependent Tools
SW-DIST.SD-AGENT B.11.23.0706.063 HP-UX Software Distributor agent and daemon
SW-DIST.SD-CMDS B.11.23.0706.063 HP-UX Software Distributor commands
SW-DIST.SD-ENG-A-MAN B.11.23.0706.063 HP-UX Software Distributor Manual Pages
SW-DIST.SD-EXAMPLES B.11.23.0706.063 HP-UX Software Distributor Example PSFs
SW-DIST.SD-FAL B.11.23.0706.063 HP-UX Software Distributor functional area launcher
SW-DIST.SD-FRE-I-MSG B.11.23.0706.063 French message catalogs for SD
SW-DIST.SD-GER-I-MSG B.11.23.0706.063 Japanese EUC message catalogs for SD
SW-DIST.SD-HELP B.11.23.0706.063 HP-UX Software Distributor on-line help
SW-DIST.SD-JPN-E-HELP B.11.23.0706.063 Japanese EUC Online Help for SD
SW-DIST.SD-JPN-E-MAN B.11.23.0706.063 HP-UX Software Distributor Japanese EUC Manual Pages
SW-DIST.SD-JPN-E-MSG B.11.23.0706.063 Japanese EUC message catalogs for SD
SW-DIST.SD-JPN-S-HELP B.11.23.0706.063 Japanese SJIS Online Help for SD
SW-DIST.SD-JPN-S-MAN B.11.23.0706.063 HP-UX Software Distributor Japanese SJIS Manual Pages
SW-DIST.SD-JPN-S-MSG B.11.23.0706.063 Japanese SJIS message catalogs for SD
SW-DIST.SD-KOR-E-MSG B.11.23.0706.063 Korean message catalogs for SD
SW-DIST.SD-PROVIDER B.11.23.0706.063 HP-UX Software Distributor WBEM Provider
SW-DIST.SD-TCH-B-MSG B.11.23.0706.063 Traditional Chinese (big5) message catalogs for SD
SW-DIST.SD-TCH-H-MSG B.11.23.0706.063 Simplified Chinese (hp15CN) message catalogs for SD
SW-DIST.SD2-AGENT B.11.23.0706.063 HP-UX Software Distributor agent and daemon
SW-DIST.SD2-CMDS B.11.23.0706.063 HP-UX Software Distributor commands
SW-DIST.SD2-PROVIDER B.11.23.0706.063 HP-UX Software Distributor WBEM Provider



Dennis Handly
Acclaimed Contributor

Re: Please Help: All sw* commands show error Not Owner

# ln -f /root/swlist /usr/sbin/swlist
ln: different file system

Oops, you need to be on the same filesystem:
cp /root/swlist /usr/sbin/swlist.new
ln -f /root/swlist.new /usr/sbin/swlist

To get the date right:
touch -r /usr/sbin/swverify /usr/sbin/swlist

If you need to fix more sw commands you can do:
ln -f /usr/sbin/swlist /usr/sbin/swinstall
stalucia
Advisor

Re: Please Help: All sw* commands show error Not Owner

Thank you Dennis, now i can run all sw* commands :-)

Dennis Handly
Acclaimed Contributor

Re: Please Help: All sw* commands show error Not Owner

>now i can run all sw* commands :-)

Before you change all of them, you might want to save one of them, link it to another name.

When something like this happened in the lab, I wanted to see what was different from the bad one and the copy. I was able to mmap the file and then write it to a normal file. I then was able to see a pattern of the failure.
And the driver bug wasn't released to customers. :-)
Dennis Handly
Acclaimed Contributor

Re: Please Help: All sw* commands show error Not Owner

I just found the documented solution of how to reinstall swinstall if it is corrupted:
http://docs.hp.com/en/5992-2146/apc.html