LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-30-2011, 05:27 PM   #1
honeybadger
Member
 
Registered: Aug 2007
Location: India
Distribution: Slackware (mainly) and then a lot of others...
Posts: 855

Rep: Reputation: Disabled
Deleted 'dmesg' by mistake....


Hi all, I had upgraded from slackware 13 to 13.1 and finally 13.37.
After this I noticed that 'dmesg' could only be executed as root. So inorder for a user to execute 'dmesg' I executed 'ln -s /bin/dmesg /usr/bin/dmesg'.
What happened next is the symlink was created but the dmesg executable was deleted.
I do not want to reinstall the OS (very time consuming on a P3 with 512MB RAM) so I want to know which package provides dmesg so that I can reinstall it.
The dmesg man page indicated that klogd will provide the package but then when I reinstalled it it was a no go.
Can someone tell me how to get the dmesg back?
Thanks for your help.
 
Old 05-30-2011, 05:33 PM   #2
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,063

Rep: Reputation: Disabled
Hi, dmesg is provided by util-linux-ng (in the /a series).

TIP: 'grep <filename> /var/log/packages/*' will tell you which package(s) provide <filename>, if installed.

Last edited by Didier Spaier; 05-30-2011 at 05:37 PM.
 
1 members found this post helpful.
Old 05-30-2011, 05:44 PM   #3
vulcan59
Member
 
Registered: Sep 2007
Location: UK
Distribution: Slackware 14.2 & Current
Posts: 96

Rep: Reputation: 30
Not being able to run dmesg as an ordinary user is a security feature added to more recent kernels. You can enable it for users by running
Code:
sysctl -w kernel.dmesg_restrict=0
I have this in my rc.local.
 
1 members found this post helpful.
Old 05-30-2011, 05:52 PM   #4
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
You can also get the information which package contains with slackpkg, like
Code:
slackpkg file-search dmesg
 
2 members found this post helpful.
Old 05-30-2011, 07:55 PM   #5
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367

Rep: Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843
Quote:
Originally Posted by vulcan59 View Post
Not being able to run dmesg as an ordinary user is a security feature added to more recent kernels. You can enable it for users by running
Code:
sysctl -w kernel.dmesg_restrict=0
I have this in my rc.local.
It's probably better (well, not better, but more 'proper') to throw kernel parameters into /etc/sysctl.conf since
Code:
/sbin/sysctl -e -p /etc/sysctl.conf
is called from /etc/rc.d/rc.S anyway. See `man sysctl.conf`.
 
3 members found this post helpful.
Old 05-30-2011, 08:23 PM   #6
jamesf
Member
 
Registered: Dec 2004
Location: USA
Distribution: Slackware 12, Slackware64 14.2
Posts: 236
Blog Entries: 1

Rep: Reputation: 57
Quote:
Originally Posted by TobiSGD View Post
You can also get the information which package contains with slackpkg, like
Code:
slackpkg file-search dmesg
I always forget to use slackpkg that way, instead I do
Code:
grep somefilename /var/log/packages/*
and I use /var/log/removed_packages similarly.
 
Old 05-30-2011, 09:32 PM   #7
chrisretusn
Senior Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware64-current
Posts: 2,978

Rep: Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556
Quote:
Originally Posted by SilverBack View Post
Hi all, I had upgraded from slackware 13 to 13.1 and finally 13.37.
After this I noticed that 'dmesg' could only be executed as root. So inorder for a user to execute 'dmesg' I executed 'ln -s /bin/dmesg /usr/bin/dmesg'.
What happened next is the symlink was created but the dmesg executable was deleted.
That should not have happened. This would be more of a concern to me...

At any rate
Files in /bin are executable by users.
Code:
-rwxr-xr-x 1 root root 9432 Feb 16 14:34 /bin/dmesg*
So creating a symlink in /usr/bin would have failed anyway since other factors are stopping dmesg from being run by users.

The solutions have already been posted, with T3slider's post here being the preferred method.

Last edited by chrisretusn; 05-30-2011 at 09:34 PM.
 
Old 05-31-2011, 02:18 AM   #8
honeybadger
Member
 
Registered: Aug 2007
Location: India
Distribution: Slackware (mainly) and then a lot of others...
Posts: 855

Original Poster
Rep: Reputation: Disabled
Thanks for all your answers guys - I also learnt some tricks here which would undoubtedly help me in the future.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] I have deleted crontab by mistake riganta Slackware 10 10-25-2010 01:41 PM
deleted by mistake .thunderbird valemon Linux - General 6 08-28-2007 05:12 PM
Am i done for? Deleted /etc by mistake AriciU Slackware 10 07-07-2007 06:07 AM
Deleted rc.local by mistake Fredstar *BSD 4 06-18-2007 08:44 AM
help pls! deleted something by mistake marlor Slackware 2 02-05-2005 08:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration