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, firstname.lastname@example.org
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, email@example.com
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, firstname.lastname@example.org
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, email@example.com
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, firstname.lastname@example.org
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, email@example.com
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, firstname.lastname@example.org
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, email@example.com
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, firstname.lastname@example.org
pwconv is the command for synchronizing/updating the shadow file after creating a user account. —Usman S. Ansari, email@example.com
To remove the suid bit use chmod -s filename. —Marc Merlin, firstname.lastname@example.org
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, email@example.com
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, firstname.lastname@example.org
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, email@example.com
Practical Task Scheduling Deployment
July 20, 2016 12:00 pm CDT
One of the best things about the UNIX environment (aside from being stable and efficient) is the vast array of software tools available to help you do your job. Traditionally, a UNIX tool does only one thing, but does that one thing very well. For example, grep is very easy to use and can search vast amounts of data quickly. The find tool can find a particular file or files based on all kinds of criteria. It's pretty easy to string these tools together to build even more powerful tools, such as a tool that finds all of the .log files in the /home directory and searches each one for a particular entry. This erector-set mentality allows UNIX system administrators to seem to always have the right tool for the job.
Cron traditionally has been considered another such a tool for job scheduling, but is it enough? This webinar considers that very question. The first part builds on a previous Geek Guide, Beyond Cron, and briefly describes how to know when it might be time to consider upgrading your job scheduling infrastructure. The second part presents an actual planning and implementation framework.
Join Linux Journal's Mike Diehl and Pat Cameron of Help Systems.
Free to Linux Journal readers.Register Now!
- SUSE LLC's SUSE Manager
- Murat Yener and Onur Dundar's Expert Android Studio (Wrox)
- My +1 Sword of Productivity
- Managing Linux Using Puppet
- Non-Linux FOSS: Caffeine!
- Doing for User Space What We Did for Kernel Space
- SuperTuxKart 0.9.2 Released
- Google's SwiftShader Released
- Parsing an RSS News Feed with a Bash Script
- Rogue Wave Software's Zend Server
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide