howto kill x if x is running?
Organization: Thought Unlimited. Public service Unix since 1986. Of_Interest: With 27 years of service to the Unix community. guys, I've evidently had too many pain meds; this shelll script should be easy. say that I have a utility xxx running sometimes. xxx is soaking up a chunk of my load. I have to use top to find if xxx is running, then kill -9 to kill xxx and have a steady load of, say, between 0.10 and 0.15. what's the script that can do this? gary -- Gary Kline kl...@thought.org http://www.thought.org Public Service Unix Twenty-seven years of service to the Unix community. http://www.thought.org/HOPE ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Diskless question
From: Bernt Hansson b...@bananmonarki.se To: Bernt Hansson b...@bananmonarki.se Cc: Julian H. Stacey j...@berklix.com; freebsd-questions@freebsd.org Sent: Saturday, September 14, 2013 12:37 PM Subject: Re: Diskless question On 2013-09-14 15:41, Bernt Hansson wrote: On 2013-09-14 11:05, Julian H. Stacey wrote: Hi, Reference: From: Bernt Hansson b...@bananmonarki.se Date: Sat, 14 Sep 2013 09:36:58 +0200 Bernt Hansson wrote: Hello list! I have a setup with a diskless machine and working, but I can not log in as root on the diskless. How to proceed? Log in as non root see what /var/log shows Mount the media elsewhere then either give a good look at what might be wrong, relax some restrictive permissions create some temporary back doors. rlogin, ssh, no or simple password on toor etc Cheers, Julian I solved it. Root did not have a password as strange as it may be. Unsolved. Root do not have a password, pressing enter at the passwd prompt gives sorry ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org It's been a long time since I did this but there was some command for passwd for root which I had to do as well. The initial diskless boot will login you in with root without a password as I recall. Aha, here it is... cd /etc cp passwd master.passwd /pxeroot/conf/default/etc/ cd /pxeroot/etc pwd_mkdb -d /pxeroot/etc master.passwd You may need to adjust this based on your setup. I found lots of good info on diskless booting at this site: http://www.nber.org/sys-admin/FreeBSD-diskless.html ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: howto kill x if x is running?
On Sat, 14 Sep 2013 23:20:46 -0700, Gary Kline wrote: say that I have a utility xxx running sometimes. xxx is soaking up a chunk of my load. I have to use top to find if xxx is running, then kill -9 to kill xxx and have a steady load of, say, between 0.10 and 0.15. what's the script that can do this? Quick and dirty, needs adjustments. Repeat the following (endless loop, depending on the shell you're using): top -n | awk '/%/ { load=$11; sub(%, , load); sub(\\., , load); if(load 1000 load 1500) print $1 }' | xargs kill -9 The margin is coded in the conditional: 1000 means 10.00% WCPU (load 0.10), 1500 means 15.00% WCPU (load 0.15). You will have to set the valid load accordingly. Done some minor testing, killed my media player (as expected). I'm sure someone will present a much better, less dirtier approach to accomplish the requested task. :-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ... ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: howto kill x if x is running?
On 15/09/2013 07:20, Gary Kline wrote: I've evidently had too many pain meds; this shelll script should be easy. say that I have a utility xxx running sometimes. xxx is soaking up a chunk of my load. I have to use top to find if xxx is running, then kill -9 to kill xxx and have a steady load of, say, between 0.10 and 0.15. what's the script that can do this? The classic answer to this is that you need to find the pid of your 'xxx' process, and then kill it using that. Some combination of ps(1) and grep(1) usually sufficed. However nowadays there's the very handy pkill(1): pkill -9 xxx Tying that in with the trigger based on system load: #!/bin/sh load=$(sysctl vm.loadavg | cut -d ' ' -f 3) too_high=$(bc -e $load 0.15 /dev/null) if [ $too_high = '1' ]; then pkill -9 xxx fi Note the use of bc(1) to compare floating point values -- the built-in $((shell arithmetic)) or expr(1) only do integer arithmetic. One final point -- instead of killing the xxx process when the load gets too high, you could simply renice(1) it to very low priority. Or even better, use idprio(1). This won't actually affect the system load values much as 'system load' is an average of the number of processes requesting a CPU time slice. What it does do is mean that your 'xxx' process is always pretty much the last process to get any CPU time -- so everything else should remain responsive, and your xxx process will only run when the system is otherwise idle. Cheers, Matthew -- Dr Matthew J Seaman MA, D.Phil. PGP: http://www.infracaninophile.co.uk/pgpkey JID: matt...@infracaninophile.co.uk signature.asc Description: OpenPGP digital signature
pkg_create: corrupted record for package
When running portmaster, I have run into this problem with a few ports: === Creating a backup package for old version kdeartwork-4.10.5 pkg_create: corrupted record for package kdeartwork-4.10.5 (pkgdep line without argument), ignoring pkg_delete: corrupted record for package kdeartwork-4.10.5 (pkgdep line without argument), ignoring I have tried rebuilding the port several times, but the problem still remains. The ports with this problem are, when using pkg_version: pkg_version: corrupted record for package kactivitymanagerd-4.10.5 (pkgdep line without argument), ignoring pkg_version: corrupted record for package kalzium-4.10.5 (pkgdep line without argument), ignoring pkg_version: corrupted record for package kde-workspace-4.10.5 (pkgdep line without argument), ignoring pkg_version: corrupted record for package kdenetwork-4.10.5 (pkgdep line without argument), ignoring pkg_version: corrupted record for package kdeplasma-addons-4.10.5 (pkgdep line without argument), ignoring pkg_version: corrupted record for package kdetoys-4.10.5 (pkgdep line without argument), ignoring I have not found a way to eliminate this problem and Google apparently has not been of much help either. I am open to suggestions. -- Carmel ✌ carmel...@hotmail.com Disclaimer: off-list followups get on-list replies or get ignored. Please do not ignore the Reply-To header. __ ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: pkg_create: corrupted record for package
On Sun, Sep 15, 2013 at 4:23 PM, Carmel carmel...@hotmail.com wrote: When running portmaster, I have run into this problem with a few ports: === Creating a backup package for old version kdeartwork-4.10.5 pkg_create: corrupted record for package kdeartwork-4.10.5 (pkgdep line without argument), ignoring pkg_delete: corrupted record for package kdeartwork-4.10.5 (pkgdep line without argument), ignoring I have tried rebuilding the port several times, but the problem still remains. The ports with this problem are, when using pkg_version: pkg_version: corrupted record for package kactivitymanagerd-4.10.5 (pkgdep line without argument), ignoring pkg_version: corrupted record for package kalzium-4.10.5 (pkgdep line without argument), ignoring pkg_version: corrupted record for package kde-workspace-4.10.5 (pkgdep line without argument), ignoring pkg_version: corrupted record for package kdenetwork-4.10.5 (pkgdep line without argument), ignoring pkg_version: corrupted record for package kdeplasma-addons-4.10.5 (pkgdep line without argument), ignoring pkg_version: corrupted record for package kdetoys-4.10.5 (pkgdep line without argument), ignoring I have not found a way to eliminate this problem and Google apparently has not been of much help either. I am open to suggestions. -- Carmel ✌ carmel...@hotmail.com Hi Carmel, Have you tried this? # portmaster --check-depends Kind regards, Alexandre ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: pkg_create: corrupted record for package
On Sun, 15 Sep 2013 16:56:20 +0200 Alexandre articulated: Have you tried this? # portmaster --check-depends Yes, it ran to completion but fixed nothing. -- Carmel ✌ carmel...@hotmail.com Disclaimer: off-list followups get on-list replies or get ignored. Please do not ignore the Reply-To header. __ ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: pkg_create: corrupted record for package
On Sun, Sep 15, 2013 at 5:11 PM, Carmel carmel...@hotmail.com wrote: On Sun, 15 Sep 2013 16:56:20 +0200 Alexandre articulated: Have you tried this? # portmaster --check-depends Yes, it ran to completion but fixed nothing. -- Carmel ✌ carmel...@hotmail.com Carmel, # grep ^@pkgdep /var/db/pkg/*/+CONTENTS | awk '{ if (NF != 2) { print $1 } }' | cut -d':' -f1 Then reinstall affected packages. Kind regards, Alexandre ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Migration TeX/LaTeX: from teTeX -- TeXlive
On Sat, Sep 14, 2013 at 02:22:12PM +0200, O. Hartmann wrote: I use for my day to day work teTeX, but I run more and more into several limitations due to the fact, teTeX isn't any more (and regretably) maintained/developed by Th. Esser (that is what I know). Upstream teTeX has indeed been deprecated in favor of TeXLive. Well, TeXlive is now in the ports tree, but I had recently on a server, on which I tried to migrate, massive problems with the most recent CURRENT, where gcc is completely gone (luckily) and converters/iconv has been removed. I can not clearly say what causes the problems, since there seem to be remains of teTeX in the system, but they are needed for some essential facilities and I do not dare ripping them off. Was your machine updated from 9.x to CURRENT? In that case you should really remove _all_ ports and re-install them. That is the only way to get rid of old junk when switching to a new major version. Before I start time consuming experiments, I'd like to ask whether there is a smooth way of migration. And for that, please enlighten me how I can extract those ports installed and needed by teTeX (a kind of port-traceback of required ports) and delete them, as far as they do not share common being required by xxx port, too. Personally I don't think TeX is a good fit for the ports tree (because of duplication of effort). I installed TeXLive using its own installer long before it was present in the ports tree. Since TeXLive is very complete and self-contained, I don't have other ports that depend on TeX. I am certain that TeXLive has pre-built binaries for FreeBSD 9, but I don't know about CURRENT. To see which ports require (parts of) teTeX, use `pkg_info -Rx tetex` Roland -- R.F.Smith http://rsmith.home.xs4all.nl/ [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated] pgp: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 (KeyID: C321A725) pgpwUlqhM9g4C.pgp Description: PGP signature
Re: Migration TeX/LaTeX: from teTeX -- TeXlive
On 09/15/2013 02:00 PM, Roland Smith wrote: Personally I don't think TeX is a good fit for the ports tree (because of duplication of effort). I installed TeXLive using its own installer long before it was present in the ports tree. Since TeXLive is very complete and self-contained, I don't have other ports that depend on TeX. +1 My TeX dependency and maintenance problems all but disappeared when I moved to the freestanding TeXLive installation. I run a nightly cron job to get the latest updates via tlmgr and it works like a charm. -- Tim Daneliuk tun...@tundraware.com PGP Key: http://www.tundraware.com/PGP/ ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Getting tlmgr working
Has there been any movement on getting tlmgr working on FreeBSD? The inability to get and install updates is annoying. -- Jerry ♔ Disclaimer: off-list followups get on-list replies or get ignored. Please do not ignore the Reply-To header. __ ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: syslog-ng33 fails to build
On 09/13/2013 01:53 AM, C. L. Martinez wrote: Hi all, I am trying to build syslog-ng33 (release 3.3.9) using a poudriere server, but build process fails: snip configure: error: in `/wrkdirs/usr/ports/sysutils/syslog-ng33/work/syslog-ng-3.3.9': configure: error: The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables EVTLOG_CFLAGS and EVTLOG_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. It is strange, because previous build (on August 27) works without problems ... Any idea?? Probably because syslog-ng relies upon pkgconfig, but assumes it will be installed by one of the dependent ports so doesn't explicitly declare the dependency. Poudriere has a habit of only installing the immediate dependencies of the package it is currently compiling, so exposes such issues when a port is updated, but none of its dependencies are. Bug ports/181098 is another I found like this. Add this to the port's Makefile after the include of bsd.port.options.mk: USES+= pkgconfig If that corrects the issue you're seeing, submit a pr. -- Fuzzy love, -CyberLeo Technical Administrator CyberLeo.Net Webhosting http://www.CyberLeo.Net cyber...@cyberleo.net Furry Peace! - http://www.fur.com/peace/ ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Installworld on amd64 fails on libc.a on r255342
On 09/13/2013 02:46 PM, Eir Nym wrote: I get this error for a while, and don't know what to do with. I build the world, then try to install it into DESTDIR. And at this point I always get error that libc.a can't be found. To eliminate any mistakes in commits I've run snapshot r255342 from FTP in VM and build sources it contains. my building and installing world with following commands: # make toolchain buildworld __MAKE_CONF=/dev/null SRCCONF=src.conf # make hierarchy distrib-dirs distribution installworld Ensure all the variables you define on the make command line are the same for all invocations of make, unless you're absolutely certain they don't apply: make -C /usr/src __MAKE_CONF=/dev/null SRCCONF=/my/src.conf buildworld make -C /usr/src __MAKE_CONF=/dev/null SRCCONF=/my/src.conf DESTDIR=/path distrib-dirs distribution installworld Setting some knobs for buildworld but not for installworld will, at best, compile things that won't be installed; and, at worst, attempt to install things that haven't been compiled. -- Fuzzy love, -CyberLeo Technical Administrator CyberLeo.Net Webhosting http://www.CyberLeo.Net cyber...@cyberleo.net Furry Peace! - http://www.fur.com/peace/ ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Migration TeX/LaTeX: from teTeX -- TeXlive
On Sun, 15 Sep 2013 21:00:22 +0200, Roland Smith wrote: Personally I don't think TeX is a good fit for the ports tree (because of duplication of effort). In conclusion, that could be said about many other software that brings its own package management. Of course, LaTeX is a big and complex beast that TeXLive manages well (instead of the system-provided tools for managing the ports tree). In my opinion, a good _integration with_ the ports tree is important, so dependencies will be resolved properly (and you won't end up havong both TeXLive _and_ teTeX on your system for no particular need). On the other hand, this might introduce demands of other software compilations to move their management out of the system's range, so we end up micro-managing many different sets of software in their own specific way, abandoning the centralized means of maintaining our software... I installed TeXLive using its own installer long before it was present in the ports tree. It should maybe be possible (and encouraged?) to use a concept like using the ports tree for invoking the TeXLive custom installer, so you don't have to manually download and extract stuff, a simple make install from the ports tree would do that for you. However, the TeXLive installer co-operates well with FreeBSD, so it's not a big problem to get TeXLive installed and running. Since TeXLive is very complete and self-contained, I don't have other ports that depend on TeX. It's the port maintainers' task to take care of the proper declaration of dependencies, and for system tools to handle them. I don't think it is a big problem to make this consistent with how TeXLive handles things. I am certain that TeXLive has pre-built binaries for FreeBSD 9, but I don't know about CURRENT. It would be even more greaterer to have pkg add texlive working, performing the download, and installing the FreeBSD binaries and libraries as needed, while keeping the system records intact. :-) To see which ports require (parts of) teTeX, use `pkg_info -Rx tetex` Plus `pkg_info -Rx teTeX` because of the way it is spelled. :-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ... ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: syslog-ng33 fails to build
On Sun, Sep 15, 2013 at 7:40 PM, CyberLeo Kitsana cyber...@cyberleo.netwrote: On 09/13/2013 01:53 AM, C. L. Martinez wrote: Hi all, I am trying to build syslog-ng33 (release 3.3.9) using a poudriere server, but build process fails: snip configure: error: in `/wrkdirs/usr/ports/sysutils/syslog-ng33/work/syslog-ng-3.3.9': configure: error: The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables EVTLOG_CFLAGS and EVTLOG_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. It is strange, because previous build (on August 27) works without problems ... Any idea?? Probably because syslog-ng relies upon pkgconfig, but assumes it will be installed by one of the dependent ports so doesn't explicitly declare the dependency. Poudriere has a habit of only installing the immediate dependencies of the package it is currently compiling, so exposes such issues when a port is updated, but none of its dependencies are. Bug ports/181098 is another I found like this. Add this to the port's Makefile after the include of bsd.port.options.mk: USES+= pkgconfig If that corrects the issue you're seeing, submit a pr. Im actually wondering if its deeper then this as, today i built two ports that had USE_GNOME= pkgconfig which both failed to build, i was wondering is somethings changed, this occurs on both stable/9 and alpha/10 -- Fuzzy love, -CyberLeo Technical Administrator CyberLeo.Net Webhosting http://www.CyberLeo.Net cyber...@cyberleo.net Furry Peace! - http://www.fur.com/peace/ ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: howto kill x if x is running?
Organization: Thought Unlimited. Public service Unix since 1986. Of_Interest: With 27 years of service to the Unix community. On Sun, Sep 15, 2013 at 07:56:17AM +0100, Matthew Seaman wrote: On 15/09/2013 07:20, Gary Kline wrote: I've evidently had too many pain meds; this shelll script should be easy. say that I have a utility xxx running sometimes. xxx is soaking up a chunk of my load. I have to use top to find if xxx is running, then kill -9 to kill xxx and have a steady load of, say, between 0.10 and 0.15. what's the script that can do this? The classic answer to this is that you need to find the pid of your 'xxx' process, and then kill it using that. Some combination of ps(1) and grep(1) usually sufficed. However nowadays there's the very handy pkill(1): pkill -9 xxx Tying that in with the trigger based on system load: #!/bin/sh load=$(sysctl vm.loadavg | cut -d ' ' -f 3) too_high=$(bc -e $load 0.15 /dev/null) if [ $too_high = '1' ]; then pkill -9 xxx fi Note the use of bc(1) to compare floating point values -- the built-in $((shell arithmetic)) or expr(1) only do integer arithmetic. One final point -- instead of killing the xxx process when the load gets too high, you could simply renice(1) it to very low priority. Or even better, use idprio(1). This won't actually affect the system load values much as 'system load' is an average of the number of processes requesting a CPU time slice. What it does do is mean that your 'xxx' process is always pretty much the last process to get any CPU time -- so everything else should remain responsive, and your xxx process will only run when the system is otherwise idle. Cheers, Matthew thanks very much, gents. no, it wasnt my med; it was that I slept ttoo much:: Old age. pkill -9 utility works. the 0.15 or 0.10 were arbitrrary. the default load adverage should be even less since the box is just sitting here! ...well, it's replying to lookup, I suppose. tx again, gary -- Dr Matthew J Seaman MA, D.Phil. PGP: http://www.infracaninophile.co.uk/pgpkey JID: matt...@infracaninophile.co.uk -- Gary Kline kl...@thought.org http://www.thought.org Public Service Unix Twenty-seven years of service to the Unix community. http://www.thought.org/HOPE ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org