LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.

Notices

Reply
 
Search this Thread
Old 10-24-2006, 11:28 PM   #1
rust8y
Member
 
Registered: May 2006
Posts: 100

Rep: Reputation: 15
Messages file in /var/adm


Messages file in /var/adm got deleted by accident.

How do I generate this file back?
 
Old 10-25-2006, 12:46 AM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,493

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
If you haven't reboot yet, you probably can recover its content by looking is the syslog open files.
Code:
pfiles $(pgrep syslog)
ls -l /proc/$(pgrep syslog)/fd
If you don't want to see the old content, I believe it's just created if missing at next reboot.
 
Old 10-25-2006, 09:56 PM   #3
rust8y
Member
 
Registered: May 2006
Posts: 100

Original Poster
Rep: Reputation: 15
root@prod # pfiles $(pgrep syslog)
syntax error: `(' unexpected
root@prod #

Got the above error.

I just want a new messages file. Don't really care about the contents of the old messages file.
How do I generate a new messages file in /var/adm without rebooting the Sun server?
Thank you.
 
Old 10-26-2006, 12:51 AM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,493

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
Quote:
Originally Posted by rust8y
root@prod # pfiles $(pgrep syslog)
syntax error: `(' unexpected
Use a posix compliant shell (ksh, /usr/xpg4/bin/sh, bash)
Quote:
I just want a new messages file. Don't really care about the contents of the old messages file.
How do I generate a new messages file in /var/adm without rebooting the Sun server?
You can create one, but it won't be used until next reboot. The file you deleted still exists and is the one filled by the system.
 
Old 10-26-2006, 01:46 AM   #5
rust8y
Member
 
Registered: May 2006
Posts: 100

Original Poster
Rep: Reputation: 15
root@prod # bash
root@prod # pfiles $(pgrep syslog)
211: /usr/sbin/syslogd
Current rlimit: 65536 file descriptors
0: S_IFDIR mode:0755 dev:32,8 ino:2 uid:0 gid:0 size:1536
O_RDONLY
1: S_IFDIR mode:0755 dev:32,8 ino:2 uid:0 gid:0 size:1536
O_RDONLY
2: S_IFDIR mode:0755 dev:32,8 ino:2 uid:0 gid:0 size:1536
O_RDONLY
3: S_IFCHR mode:0000 dev:32,8 ino:51058 uid:0 gid:0 rdev:41,123
O_RDWR
4: S_IFCHR mode:0600 dev:32,8 ino:3384 uid:0 gid:3 rdev:97,0
O_WRONLY|O_APPEND|O_NOCTTY|O_LARGEFILE
5: S_IFREG mode:0644 dev:32,11 ino:5103 uid:0 gid:3 size:574046
O_WRONLY|O_APPEND|O_NOCTTY|O_LARGEFILE
7: S_IFCHR mode:0000 dev:32,8 ino:51057 uid:0 gid:0 rdev:21,6
O_RDONLY
8: S_IFDOOR mode:0777 dev:310,0 ino:0 uid:0 gid:0 size:0
O_RDWR FD_CLOEXEC door to syslogd[211]
9: S_IFDOOR mode:0444 dev:311,0 ino:54 uid:0 gid:0 size:0
O_RDONLY|O_LARGEFILE FD_CLOEXEC door to nscd[236]
root@prod # ls -l /proc/$(pgrep syslog)/fd
total 1164
lr-xr-xr-x 1 root root 0 Oct 24 09:16 0 ->
lr-xr-xr-x 1 root root 0 Oct 24 09:16 1 ->
lr-xr-xr-x 1 root root 0 Oct 24 09:16 2 ->
c--------- 0 root root 41,123 Apr 26 2006 3
c--------- 1 root sys 97, 0 Oct 26 16:47 4
--w------- 1 root sys 574046 Oct 26 16:47 5
c--------- 0 root root 21, 6 Apr 26 2006 7
D--------- 2 root root 0 Jan 1 1970 8
D--------- 1 root root 0 Apr 26 2006 9
root@prod # cd /var/adm
root@prod # ls
acct aculog exacct lastlog log passwd sa sm.bin spellhist streams sulog utmpx
root@prod #
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
/var/adm/wtmp file is increasing its size...? johnsanty Linux - General 2 09-28-2006 11:05 PM
Clearing the var/log/adm/messages? as400 Solaris / OpenSolaris 17 04-17-2006 03:41 AM
Redirecting the kernel messages to file other than /var/log/messages jyotika_b83 Linux - General 3 04-28-2005 06:39 PM
Moving /var/adm and /var/lib - why does it hurt? J_Szucs Linux - General 1 09-15-2004 06:46 PM
/var/adm/messages & syslog Khalid Linux - General 0 11-08-2001 05:40 PM


All times are GMT -5. The time now is 01:22 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration