DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 24th July 2019
beavers beavers is offline
Fdisk Soldier
 
Join Date: Nov 2017
Posts: 77
Default /dev/null was a regular file?

Earlier today I applied a snapshot and rebooted, then postgresql failed to start at boot. Tried starting it manually and it gave me a message about failing to write to /dev/null. So I looked, and:

Code:
# ls -AlF /dev/null                                                      
-rw-rw----  1 root  bin  -   2,   2 Jul 23 08:35 /dev/null
(I think it was owned by the bin group, I'm recreating that from memory.) So I figure, oh the world can't write to it, and I `chmod 0666 /dev/null` and fire up postgres again, no trouble. But I think to myself, wait, isn't it supposed to be some kind of device file? So then I:

Code:
# rm /dev/null
# cd /dev
# ./MAKEDEV all
# ls -AlF /dev/null
crw-rw-rw-  1 root  wheel  -   2,   2 Jul 23 09:08 /dev/null
Ah, that looks better.

After some reflection I'm a little concerned. Could something nefarious (or quite possibly, something hamfisted I did) have caused /dev/null to become a regular file?
Reply With Quote
  #2   (View Single Post)  
Old 24th July 2019
PapaParrot's Avatar
PapaParrot PapaParrot is offline
parrot
 
Join Date: Jul 2015
Location: Durango, Mx.
Posts: 413
Default

I don't know, but this is short and the way I interpret, it should behave like a regular file:
'man null'
Quote:
parrot$ man null
NULL(4) Device Drivers Manual NULL(4)

NAME
null - the null device

DESCRIPTION
The null device accepts and reads data as any ordinary (and
willing) file, but throws it away. The length of the null
device is always zero.

FILES
/dev/null
I don't know and can not guess how your first example got that way, the second one looks the same as mine, and I have not changed anything , all though not a recent snpashot, it is a failrly recent fresh install.
Code:
parrot$ ls -AlF /dev/null
crw-rw-rw-  1 root  wheel    2,   2 Jul 23 21:08 /dev/null
parrot$
__________________
My best friends are parrots
Reply With Quote
  #3   (View Single Post)  
Old 24th July 2019
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,738
Default

Another method is to use MAKEDEV std to re-create the correct special file. See MAKEDEV(8).

I cannot tell you how you overlaid the special file.
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
regular server crashes - /proc/ Bad file descriptor carpman FreeBSD General 2 1st June 2010 11:51 AM
Multiple serial consoles via null modem cable or serial console server J65nko General Hardware 0 16th January 2010 12:01 AM
OpenBSD OpenBSD Reliability Fix: kernel NULL pointer dereference in getsockopt() J65nko News 0 28th October 2009 11:56 PM
PHP regular expression help cajunman4life Programming 2 16th August 2008 05:17 PM
are you an former bsdforum regular? ephemera Off-Topic 18 28th July 2008 12:57 PM


All times are GMT. The time now is 05:34 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick