Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
mkdir: cannot create directory `/dev/cgroup/cpu/user/5900': No such file or directory
bash: /dev/cgroup/cpu/user/5900/tasks: No such file or directory
bash: /dev/cgroup/cpu/user/5900/notify_on_release: No such file or directory
It seems like it's probably from this part of .bashrc:
if [ "$PS1" ] ; then
mkdir -m 0700 /dev/cgroup/cpu/user/$$
echo $$ > /dev/cgroup/cpu/user/$$/tasks
echo "1" > /dev/cgroup/cpu/user/$$/notify_on_release
What does this code do, why, and what's causing it to go wrong?
If you don't know what this code is supposed to do, you can just ignore it and comment it out (until you find why it's there). Anyway, it should create a directory whose name is the process ID of the current shell ($$). It fails because the parent directory /dev/cgroup/cpu/user does not exist. The if [ "$PS1" ] part denotes it must be an interactive shell, PS1 being the environment variable which sets the appearance of the shell prompt.
At a guess I'd say its failing because you're logging in as a non-root user and trying to write to /dev which typically is not set to allow such writes.
As to why it is in your .bashrc in the first place I can't say. Did you maybe copy this from an older system? Is this a new user and it got copied in from /etc/skel?
The "$$" is the process ID for the bash shell that ran it which was 5900 when you ran it but would be different the next time.
What Linux distro are you running? (RHEL? SUSE? Ubuntu? Something Else?) What version of that distro?
What does "ls -ld /dev" show?
What does "df -h /dev" show?
/dev isn't a real filesystem so has no mount device. Its purpose is to hold all the special devices for various hardware on the system such as your hard drives (/dev/sd*, /dev/hd*), your serial ports (/dev/tty*) your pseudo terminals (/dev/pts/*) and a slew of others. Typically user processes wouldn't be creating anything in /dev though they are doing quite a bit of interaction with the devices that are already there.
Don't assume: who did you login as? Also, for confirmation try the id http://linux.die.net/man/1/id cmd.
As above, it's an odd place to create a dir from the cmd line & you'd have to be root to do it.
Is there a particular reason you are trying to do this? If not, as above, just comment that block out, or even delete it...