Re: Tried to symlink /etc to another disk, now stuck
Steve Bertrand wrote, On 6/12/2008 7:09 PM: Steve Bertrand wrote: Dan Nelson wrote: I'm off to try it. I've got a system here with a da device. I'll fsck up /etc/fstab, reboot, and report back with the appropriate mountroot> prompt entry... # cat /etc/fstab # DeviceMountpoint FStype Options Dump Pass# /dev/da0a / ufs rw,noatime 1 1 md /tmpmfs rw,-s32M,nosuid,noatime 0 0 (..snip..) ..change /etc/fstab to mount root to /dev/ad15a, reboot: mountroot> # mountroot>ufs:/dev/da0a {ENTER} ...machine boots up. To the OP...if you know what your disk type is, you CAN get it to continue to mount root at the mountroot prompt. Furthering that, you can also fsck and mount your other disk mountpoints in order to gain access to your editing binaries. There is no need to use an external resource to boot the machine from if you are already aware that the only thing that got fsck'd up is the mountpoints in the fstab (or, like in this case, the file was unavailable entirely). The disk structure is still the same, and the system can see this with manual intervention. OP: at the mountroot> prompt, try this: ufs:/dev/ad0s1a and see if you get anywhere. Steve Thanks to Steve, Dan and Andrew for offering suggestions for regaining access to my box! I was finally able to mount / from the mountroot> prompt using "ufs:/dev/aacd0s1a" (this is a Dell PowerEdge server with a SCSI RAID5 array.) Fortunately, there was an "/etc.old directory left over from the last patch level upgrade I did; that was enough to get the system booting normally so that I could copy back the former /etc directory that I had moved at the start of this whole fiasco. I think I will start retaining electronic and hard-copy fstab files from my FreeBSD boxes for future reference, as Steve suggested in a later message. -- Glenn Gillis ELAW U.S. Information Technology Manager Environmental Law Alliance Worldwide http://www.elaw.org ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Tried to symlink /etc to another disk, now stuck
I think I did just about the worst thing I could do to my organization's FreeBSD-4.11 email server today: I was trying to free up space on the root disk and attempted to copy the /etc directory to another disk, /new/etc, then delete and symlink the old location to the new: $ sudo cp -Rp /etc /new/etc $ sudo rm -rd /etc/; sudo ln -s /new/etc /etc Of course, with the sudoers file in the original /etc directory, the first "sudo" command to remove the /etc directory disabled the second "sudo" command's ability to run. Now, I cannot log in as a privileged user to copy or move /new/etc back to /etc. (Because the password files were also in /etc.) I've tried booting into Single User mode with "boot -s" at the boot prompt, only to receive a "mountroot>" prompt wanting to know where to find the root filesystem. I've also tried booting from my installation distribution, but can't get out of the installation without the machine rebooting. To make a long story shorter, is there any hope for getting a privileged user account on this machine to move /etc back to where it should be? -- Glenn Gillis ELAW U.S. Information Technology Manager Environmental Law Alliance Worldwide http://www.elaw.org ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Obtaining a pid or process owner from netstat?
Karol Kwiatkowski wrote: > Glenn Gillis wrote: >> If 'netstat -anp tcp' shows me an IP address and port with a process >> listening on it, can anyone suggest a way to determine either the pid or >> the owner of the process that is bound to that address? >> >> In other words: >> >> % netstat -anp tcp | grep LISTEN >> tcp4 0 0 64.112.226.133.8091*.* LISTEN >> tcp4 0 0 64.112.226.133.8090*.* LISTEN >> tcp4 0 0 *.8021 *.* LISTEN >> tcp4 0 0 *.8080 *.* LISTEN >> tcp4 0 0 64.112.226.141.8080*.* LISTEN >> tcp4 0 0 64.112.226.133.13080 *.* LISTEN >> >> I'm interested in what is listening on 64.112.226.141.8080, mainly >> because I need something else to listen there. I know it's a Zope >> instance, but I can't tell *which* Zope instance (there are many on this >> box.) >> >> NB: This is on a 4.11-RELEASE-p26 box. > > Have a look at sockstat(1) and its options (like '-4' '-l' and '-p'). > > HTH, > > Karol Perfect, thanks! -- Glenn P.S. FWIW, the '-p' option does not appear to be valid under 4.11: $ sockstat -p Unknown option: p Usage: sockstat [-46clu] However, sockstat still gave me that I needed. Thx, G. smime.p7s Description: S/MIME Cryptographic Signature
Obtaining a pid or process owner from netstat?
If 'netstat -anp tcp' shows me an IP address and port with a process listening on it, can anyone suggest a way to determine either the pid or the owner of the process that is bound to that address? In other words: % netstat -anp tcp | grep LISTEN tcp4 0 0 64.112.226.133.8091*.* LISTEN tcp4 0 0 64.112.226.133.8090*.* LISTEN tcp4 0 0 *.8021 *.* LISTEN tcp4 0 0 *.8080 *.* LISTEN tcp4 0 0 64.112.226.141.8080*.* LISTEN tcp4 0 0 64.112.226.133.13080 *.* LISTEN I'm interested in what is listening on 64.112.226.141.8080, mainly because I need something else to listen there. I know it's a Zope instance, but I can't tell *which* Zope instance (there are many on this box.) NB: This is on a 4.11-RELEASE-p26 box. Thanks, -- Glenn Gillis ELAW U.S. Information Technology Manager Environmental Law Alliance Worldwide http://www.elaw.org smime.p7s Description: S/MIME Cryptographic Signature
Strange processes left over from periodic daily
[Not sure what happened to the last copy of this message, but it looks like crap in the archive! G.] In attempting to track down some odd new sluggishness in my FreeBSD 4.11 mail server, I have run across some odd processes that seem to be hanging on from the daily periodic cron jobs. Attached are the output from "top" and "ps" showing these lingering processes. I learned from this list's archives that the angle brackets mean the process has been completely swapped out to disk, but I don't understand *why* there are so many daily periodic jobs hanging around. My other production FreeBSD box shows no such periodic jobs handing around (although it does have similar "" processes listed in top's output, belonging to Apache's rotatelogs utility.) Would anyone in the know be kind enough to explain why those cron processes might still hanging around, and if they are anything to be concerned about performance-wise? Thanks! Glenn Gillis [EMAIL PROTECTED] E-LAW U.S. Information Technology Manager Environmental Law Alliance Worldwide http://www.elaw.org last pid: 6673; load averages: 43.01, 40.96, 40.99 up 35+04:57:2915:39:14 364 processes: 43 running, 315 sleeping, 6 zombie Mem: 275M Active, 70M Inact, 104M Wired, 18M Cache, 61M Buf, 32M Free Swap: 1008M Total, 356M Used, 652M Free, 35% Inuse PID USERNAME PRI NICE SIZERES STATETIME WCPUCPU COMMAND 70200 root 60 0 224K 100K RUN 31.0H 2.20% 2.20% mailwrapper 41000 root 61 0 912K 252K RUN993:01 2.20% 2.20% mailwrapper 61495 root 60 0 228K 104K RUN 24.4H 2.10% 2.10% mailwrapper 17252 root 60 0 224K 100K RUN708:43 2.10% 2.10% mailwrapper 53404 root 61 0 920K 452K RUN 67.2H 2.05% 2.05% mailwrapper 93538 root 60 0 940K 516K RUN420:20 2.05% 2.05% mailwrapper 78591 root 60 0 924K 256K RUN274:55 2.00% 2.00% mailwrapper 44775 root 60 0 924K 284K RUN 19:29 2.00% 2.00% mailwrapper 18812 root 60 0 224K 100K RUN 49.5H 1.95% 1.95% mailwrapper 65080 root 59 0 924K 248K RUN 33.6H 1.90% 1.90% mailwrapper 48579 root 60 0 924K 284K RUN 26.3H 1.90% 1.90% mailwrapper 82352 root 60 0 908K 268K RUN321:58 1.90% 1.90% mailwrapper 79422 root 59 0 908K 324K RUN 44.3H 1.86% 1.86% mailwrapper 86807 root 60 0 912K 216K RUN369:52 1.86% 1.86% mailwrapper 90057 root 60 0 908K 320K RUN140:28 1.86% 1.86% mailwrapper 60282 root 60 0 256K 132K RUN 58:23 1.86% 1.86% mailwrapper 85543 root 59 0 924K 264K RUN 56.6H 1.76% 1.76% mailwrapper 63522 root 59 0 224K 100K RUN 28.5H 1.76% 1.76% mailwrapper 21402 root 59 0 908K 272K RUN842:38 1.76% 1.76% mailwrapper 4006 root 59 0 924K 264K RUN473:11 1.76% 1.76% mailwrapper 8553 root 58 0 924K 248K RUN 88.1H 1.66% 1.66% mailwrapper 67058 root 59 0 908K 372K RUN 98:30 1.66% 1.66% mailwrapper 26674 root 59 0 224K 100K RUN914:54 1.61% 1.61% mailwrapper 14292 root 59 0 228K 104K RUN773:21 1.61% 1.61% mailwrapper 58346 root 58 0 224K 100K RUN586:45 1.61% 1.61% mailwrapper 28793 root 58 0 924K 264K RUN528:57 1.61% 1.61% mailwrapper 61887 root 58 0 224K 100K RUN 17.9H 1.51% 1.51% mailwrapper 58426 root 58 0 256K 120K RUN229:08 1.51% 1.51% mailwrapper 12092 root 58 0 908K 268K RUN 40.1H 1.46% 1.46% mailwrapper 39316 root 58 0 256K 128K RUN 36.7H 1.46% 1.46% mailwrapper 60949 root 59 0 224K 100K RUN 22.6H 1.46% 1.46% mailwrapper 70089 root 58 0 256K 112K RUN 20.9H 1.46% 1.46% mailwrapper 35020 root 58 0 924K 284K RUN646:25 1.37% 1.37% mailwrapper 25457 root 58 0 920K 480K RUN184:04 1.27% 1.27% mailwrapper 5107 sympa 10 0 384M 110M nanslp 66:27 1.22% 1.22% perl 72422 root 58 0 924K 284K RUN 19.4H 1.07% 1.07% mailwrapper 6639 jabber59 0 2824K 2264K RUN 0:00 0.20% 0.10% perl 386 nut2 0 1004K 516K select 64:35 0.00% 0.00% apcsmart 4672 mysql 2 0 30004K 3700K poll49:17 0.00% 0.00% mysqld 5177 sympa 10 0 20328K 10344K nanslp 37:48 0.00% 0.00% perl 419 root 2 0 74572K 3796K poll29:05 0.00% 0.00% slapd 28242 qmails60 0 984K 536K RUN 24:34 0.00% 0.00% qmail-send 51440 bind 2 0 21720K 19756K select 13:33 0.00% 0.00% named 161 root 2 0 884K 200K poll10:12 0.00% 0.00% supervise 189 httpd 2 0 29824K 19892K accept 8:36 0.00% 0.00% perl 229 jabber 2 0 5284K 1712K select 6:52 0.00% 0.00% jabberd 237 jabber 2 0 5076K 1072K select 5:23 0.00% 0.00% j
Strange processes left over from periodic daily
In attempting to track down some odd new sluggishness in my FreeBSD 4.11 mail server, I have run across some odd processes that seem to be hanging on from the daily periodic cron jobs. Attached are the output from "top" and "ps" showing these lingering processes. I learned from this list's archives that the angle brackets mean the process has been completely swapped out to disk, but I don't understand *why* there are so many daily periodic jobs hanging around. My other production FreeBSD box shows no such periodic jobs handing around (although it does have similar "" processes listed in top's output, belonging to Apache's rotatelogs utility.) Would anyone in the know be kind enough to explain why those cron processes might still hanging around, and if they are anything to be concerned about performance-wise? Thanks! Glenn Gillis [EMAIL PROTECTED] E-LAW U.S. Information Technology Manager Environmental Law Alliance Worldwide http://www.elaw.org last pid: 6673; load averages: 43.01, 40.96, 40.99 up 35+04:57:2915:39:14 364 processes: 43 running, 315 sleeping, 6 zombie Mem: 275M Active, 70M Inact, 104M Wired, 18M Cache, 61M Buf, 32M Free Swap: 1008M Total, 356M Used, 652M Free, 35% Inuse PID USERNAME PRI NICE SIZERES STATETIME WCPUCPU COMMAND 70200 root 60 0 224K 100K RUN 31.0H 2.20% 2.20% mailwrapper 41000 root 61 0 912K 252K RUN993:01 2.20% 2.20% mailwrapper 61495 root 60 0 228K 104K RUN 24.4H 2.10% 2.10% mailwrapper 17252 root 60 0 224K 100K RUN708:43 2.10% 2.10% mailwrapper 53404 root 61 0 920K 452K RUN 67.2H 2.05% 2.05% mailwrapper 93538 root 60 0 940K 516K RUN420:20 2.05% 2.05% mailwrapper 78591 root 60 0 924K 256K RUN274:55 2.00% 2.00% mailwrapper 44775 root 60 0 924K 284K RUN 19:29 2.00% 2.00% mailwrapper 18812 root 60 0 224K 100K RUN 49.5H 1.95% 1.95% mailwrapper 65080 root 59 0 924K 248K RUN 33.6H 1.90% 1.90% mailwrapper 48579 root 60 0 924K 284K RUN 26.3H 1.90% 1.90% mailwrapper 82352 root 60 0 908K 268K RUN321:58 1.90% 1.90% mailwrapper 79422 root 59 0 908K 324K RUN 44.3H 1.86% 1.86% mailwrapper 86807 root 60 0 912K 216K RUN369:52 1.86% 1.86% mailwrapper 90057 root 60 0 908K 320K RUN140:28 1.86% 1.86% mailwrapper 60282 root 60 0 256K 132K RUN 58:23 1.86% 1.86% mailwrapper 85543 root 59 0 924K 264K RUN 56.6H 1.76% 1.76% mailwrapper 63522 root 59 0 224K 100K RUN 28.5H 1.76% 1.76% mailwrapper 21402 root 59 0 908K 272K RUN842:38 1.76% 1.76% mailwrapper 4006 root 59 0 924K 264K RUN473:11 1.76% 1.76% mailwrapper 8553 root 58 0 924K 248K RUN 88.1H 1.66% 1.66% mailwrapper 67058 root 59 0 908K 372K RUN 98:30 1.66% 1.66% mailwrapper 26674 root 59 0 224K 100K RUN914:54 1.61% 1.61% mailwrapper 14292 root 59 0 228K 104K RUN773:21 1.61% 1.61% mailwrapper 58346 root 58 0 224K 100K RUN586:45 1.61% 1.61% mailwrapper 28793 root 58 0 924K 264K RUN528:57 1.61% 1.61% mailwrapper 61887 root 58 0 224K 100K RUN 17.9H 1.51% 1.51% mailwrapper 58426 root 58 0 256K 120K RUN229:08 1.51% 1.51% mailwrapper 12092 root 58 0 908K 268K RUN 40.1H 1.46% 1.46% mailwrapper 39316 root 58 0 256K 128K RUN 36.7H 1.46% 1.46% mailwrapper 60949 root 59 0 224K 100K RUN 22.6H 1.46% 1.46% mailwrapper 70089 root 58 0 256K 112K RUN 20.9H 1.46% 1.46% mailwrapper 35020 root 58 0 924K 284K RUN646:25 1.37% 1.37% mailwrapper 25457 root 58 0 920K 480K RUN184:04 1.27% 1.27% mailwrapper 5107 sympa 10 0 384M 110M nanslp 66:27 1.22% 1.22% perl 72422 root 58 0 924K 284K RUN 19.4H 1.07% 1.07% mailwrapper 6639 jabber59 0 2824K 2264K RUN 0:00 0.20% 0.10% perl 386 nut2 0 1004K 516K select 64:35 0.00% 0.00% apcsmart 4672 mysql 2 0 30004K 3700K poll49:17 0.00% 0.00% mysqld 5177 sympa 10 0 20328K 10344K nanslp 37:48 0.00% 0.00% perl 419 root 2 0 74572K 3796K poll29:05 0.00% 0.00% slapd 28242 qmails60 0 984K 536K RUN 24:34 0.00% 0.00% qmail-send 51440 bind 2 0 21720K 19756K select 13:33 0.00% 0.00% named 161 root 2 0 884K 200K poll10:12 0.00% 0.00% supervise 189 httpd 2 0 29824K 19892K accept 8:36 0.00% 0.00% perl 229 jabber 2 0 5284K 1712K select 6:52 0.00% 0.00% jabberd 237 jabber 2 0 5076K 1072K select 5:23 0.00% 0.00% jabberd 239 jabber 2 0 5080K 1072K select 5:19 0.00% 0.00% jabberd 231 jabber 2 0