Best of Technical Support
I installed MySQL3 and PHP4 with an RPM package. Apache is running well and the MySQL server is running well from the shell. PHP4 also runs with the infophp() function call. But I can't connect to the MySQL server. What's wrong? —Haidar AM, email@example.com
You did not mention it, but I am assuming that the phpinfo script showed that you do have support for MySQL. If this is the case, please check the MySQL table to make sure that the user/password/host, localhost in this case, are correct. —Mario Neto, firstname.lastname@example.org
I've been handed the task of automating various software tasks for a company and a lot of it will entail emulating keyboard input. How can I echo key commands from a script to a program? I've not even been able to find a thorough list of what keys map to what escape sequences. Can anyone help? —Paul, email@example.com
Try the expect command. Linux Journal published an article about it a couple of months ago [That would be the December 2000 issue, Mario—Ed.]. It comes with most distributions and lets you write scripts so you can automate interactive sessions. —Mario Neto, firstname.lastname@example.org
One simple method I use to call some programs from a script is echo "y" | xyz In this case I run xyz, which will, after starting, get a “y” in response to its question. —Usman S. Ansari, email@example.com
For some reason I cannot log in as root at my local Linux box (not remote login). I can log in as any user and then su to root. Second, whenever I have to execute any commands like adduser, I have to specify the absolute path as to where the command lies such as (/usr/sbin/adduser). —Devraj Sen, firstname.lastname@example.org
The file /etc/securetty is used as a list of terminals from which root is allowed to log in. So, it is possible that the entries for your console logins were removed. Simply put them back in, i.e., to allow root to log in on the first console you should have a line consisting of:
The reason why your PATH isn't set up properly when you use su is because it isn't being treated as a login shell. So, none of the login files that pertain to root are being read. To have them read, type su - instead. —Andy Bradford, email@example.com
As far as I can tell, most if not all, Red Hat releases have been broken in so far as /sbin:/usr/sbin:/usr/local/sbin has never been in root's path for various reasons. The quick way to fix that is to simply add it to the PATH in /etc/profile. As you cannot log in as root, this is not usual behavior. You should make sure root has a valid shell, and that /etc/securetty still contains “ttyx” lines. For more clues, type tail -f /var/log/messages and look at the output when you try to log in as root from another console. —Marc Merlin, firstname.lastname@example.org
What is the command for synchronizing/updating the shadow file after I create a user account by manually editing the password file? Also, how do I remove the suid bit from any process? —Kedar, email@example.com
pwconv is the command for synchronizing/updating the shadow file after creating a user account. —Usman S. Ansari, firstname.lastname@example.org
To remove the suid bit use chmod -s filename. —Marc Merlin, email@example.com
To protect against accidentally mangling /etc/passwd if someone runs a utility that touches the file at the same time you're editing it, use vipw any time you edit /etc/passwd (it uses your chosen editor, not necessarily vi. —Don Marti, firstname.lastname@example.org
I have written a basic Perl program that reads a list of URLs from a file, goes to the URL, looks for some information and then writes that information to another file. It also writes entries to a log file and stdout. I am using the LWP::Simple module. I note the following strange behavior: 1) the log file is not written to immediately—the OS seems to be caching write requests; and 2) the program seems to die after 1-2 hours of perfectly normal operation, but restarting it works fine. —Dave Barter, email@example.com
Typing $| = 1 at the beginning of your script will force your Perl program to do a flush after every print or write (see man perlvar). As for why your program is dying, try running top at the same time to see if it's hogging all your memory. If so, rewrite it to forget about pages after it's done with them. If you run your program unattended, you should be using LWP::RobotUA, to respect webmasters' wishes about what parts of their sites are open to robots. —Don Marti, firstname.lastname@example.org
|Speed Up Your Web Site with Varnish||Jun 19, 2013|
|Non-Linux FOSS: libnotify, OS X Style||Jun 18, 2013|
|Containers—Not Virtual Machines—Are the Future Cloud||Jun 17, 2013|
|Lock-Free Multi-Producer Multi-Consumer Queue on Ring Buffer||Jun 12, 2013|
|Weechat, Irssi's Little Brother||Jun 11, 2013|
|One Tail Just Isn't Enough||Jun 07, 2013|
- Containers—Not Virtual Machines—Are the Future Cloud
- Non-Linux FOSS: libnotify, OS X Style
- Linux Systems Administrator
- Lock-Free Multi-Producer Multi-Consumer Queue on Ring Buffer
- Technical Support Rep
- Validate an E-Mail Address with PHP, the Right Way
- Senior Perl Developer
- UX Designer
- Speed Up Your Web Site with Varnish
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?