/dev/null issues

Hello All,
I have an issue since the last couple Leopard updates that I can't seem to get a handle on and think I am out of my element here so any advice appreciated.
I run 2 scripts every 10 minutes for the past 3 years and always had good results with them.
In Cronnix I have them setup as "pathToScript" >/dev/null 2>&1
One sends an email and the other runs a php cron. Both work well even now.
The only issue is that I now get an email saying:
/bin/sh: dev/null: No such file or directory
When the scripts run there is an entry in Console :
5/17/09 3:16:23 PM MyMac Ambiguous output redirect.
Thinking there is a directory missing I listed /dev/ in terminal and did receive the list of dev contents... but no null directory in the list.
I viewed the hard drive using invisibles and saw that /dev existed, but it appears when viewed as an alias, don't know if that is normal or not. I cannot move or delete the alias due to not enough permissions (might be a good thing lol)
I chowned dev/null to root:wheel from googled advice, and got no errors either.
My problem is that I don't want these emails, and wonder what is wrong with the way /dev/null is working , or not working now, and how to fix it. Can I rebuild dev/null? or fix it otherwise? Is there a fix all commend for this phenomena?
Any advice is greatly appreciated.
Jamy
Message was edited by: Jamy

Was I supposed to get something?
It depends what your script outputs. The idea was to have bash handle the output redirection to see if it you could suppress the ambiguous output redirect message. If you included the >/dev/null 2>&1 part, then I would expect to see no output. My guess was that maybe connix is using tcsh. The following tests seem to support that theory:
<pre style="border: 1px solid #ddd; padding-left: .75ex; padding-top: .25em; padding-bottom: .25em; margin-top: .5em; margin-bottom: .5em; margin-left: 1ex; max-width: 40ex; overflow: auto; font-size: 10px; font-family: Monaco, 'Courier New', Courier, monospace; color: #444; background: #eee; line-height: normal">tcsh -c 'echo hello >/dev/null 2>&1'
tcsh: Ambiguous output redirect.
sh -c 'echo hello >/dev/null 2>&1'
(no output)
</pre>
Cole

Similar Messages

  • [SOLVED] /dev/null: Permission Denied

    just tryin to run makechrootpkg, and was working fine 'till something happened recently.. now I get this:
    /usr/bin/makepkg: line 390: /dev/null: Permission denied
    ==> Retrieving Sources...
    /usr/bin/makepkg: line 461: /dev/null: Permission denied
    can anyone make sense of it? =/
    EDIT: nvm.. thankies #archlinux =P
    Last edited by Stythys (2010-06-05 17:33:33)

    I know it's solved, but I had the same issue today and fixed it like this:
    Add the following to the "mem" section in /usr/lib/udev/rules.d/50-udev-default.rules:
    SUBSYSTEM=="mem", KERNEL=="null|zero|full|random|urandom", MODE="0666"

  • [solved] systemd times out waiting for dev-null.device on encrypted fs

    I have a relatively new install of Arch on my laptop. The relevant sections of the drive setup are a luks encrypted root device (with associated unencrypted /boot), and a large ntfs device encrypted with truecrypt. That contains my home directory, which is shared with the Windows 8 dual-boot on the machine.
    I have all this mounted on boot, so my typical usage is to enter my password for the encrypted root, followed by the password for the truecrypt-encrypted data drive, then normal login.
    This has been working fine for a couple of weeks. This afternoon I rebooted my machine from Windows to Linux, at which point the secondary encrypted drive failed to mount. The root device mounts fine.
    On further examination, in the form of journalctl -xb, I'm getting the following errors after mounting the encrypted root device:
    Feb 12 21:29:54 kafka systemd[1]: Job dev-null.device/start timed out.
    Feb 12 21:29:54 kafka systemd[1]: Timed out waiting for device dev-null.device.
    -- Subject: Unit dev-null.device has failed
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/li … temd-devel
    -- Documentation: http://www.freedesktop.org/wiki/Softwar … e9d022f03d
    -- Unit dev-null.device has failed.
    -- The result is timeout.
    Feb 12 21:29:54 kafka systemd[1]: Dependency failed for Cryptography Setup for cryptdata.
    -- Subject: Unit [email protected] has failed
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/li … temd-devel
    -- Documentation: http://www.freedesktop.org/wiki/Softwar … e9d022f03d
    -- Unit [email protected] has failed.
    As my root home directory is on the root filesystem, I can still log in as root. If I try to mount or unmount the truecrypt device (located at /data) the command hangs. After removing "auto,x-systemd.automount" from that device from /etc/fstab and rebooting, I have a significant delay at boot, but I can then mount the /data device as normal.
    I can't find anything related to this either here or on Google. Any ideas?
    Last edited by tealeaf (2014-02-13 12:01:55)

    WonderWoofy wrote:A bit OT, but I just want to mention that having your $HOME on ntfs is probably not the best idea either.  It may work, but because it is not a POSIX compliant filesystem, there is a good chance you might run into some issues.
    Thanks for the warning. Sadly, as there are applications I need for work that only run in Windows, I need to dual boot this machine with Windows 8.1. This is the best option I can find for sharing my home directory, which is also a necessity due to the amount of data I have to share between the systems. I would much rather trust to ntfs-3g-ar and its UserMapping (and all the fiddling with ACLs that I had to do) than to the Windows ext2 drivers I can find. They all seem to be several years out of date. Linux is much better at talking NTFS than Windows is at talking EXT. (To be honest, I'm actually quite impressed with Windows 8 since the upgrade to 8.1. As a long term Arch user and a fan of tiling window managers it's interesting to see Windows moving in the right direction. )
    With 'permissions' in the /etc/fstab and the .NTFS-3G/UserMapping file in place it works almost seamlessly. (It took a lot of tinkering with ACLs in Windows and Linux, but it's working very well now. One tip that I'll write here in case it's of use is that you want the last line of the UserMapping file to be a 'generic' mapping. When I didn't have that there were very strange things going on.)
    The only two minor problems I have now are:
    1) A few applications don't like FUSE filesystems. Steam worked for a while and then broke; reinstalling it failed at every stage. When I checked, it seems that FUSE is a known problem for Steam. (I don't think it's restricted to NTFS.) My response to that was to create /home/.local/$HOME on my root (ext4) filesystem and symlink out to it for troublesome applications.
    2) There are a few characters for filenames that Windows doesn't like, making those files inaccessible in Windows. (Colons are the major culprit.) They're usually quite easily renamed. (The exception being my .maildir folder, which I have had to duplicate natively in cygwin.)
    Neither of these are anything more than minor niggles. I appreciate the warning, though.
    Having said that, if you have an alternative that lets me share a truecrypt-encrypted drive between Linux and Windows that is better than the NTFS-3G approach, I'd love to hear it for future reference.

  • /dev/null file permission changes frequently

    Hi,
    We are experiencing file permission change issue frequently for the
    following files:
    root@domain5 # ls -l /devices/pseudo/mm@0:null
    crw-rw-rw- 1 root sys 13, 2 Apr 22 2009
    /devices/pseudo/mm@0:null
    root@domain5 # ls -l /dev/null
    crw-rw-rw- 1 root sys 13, 2 Oct 25 07:01 /dev/null
    By default, above is the file permission settings. If the file permission
    changes, it will look like as below:
    root@domain5 # ls -l /devices/pseudo/mm@0:null
    cr--r--r-- 1 root sys 13, 2 Apr 22 2009
    /devices/pseudo/mm@0:null
    root@domain5 # ls -l /dev/null
    cr--r--r-- 1 root sys 13, 2 Oct 25 07:01 /dev/null
    Due to this file permission change the script which uses this file loose
    the write permission and the script fails. To fix this issue, we will be
    manually changing the permission. Can you please help me to know the cause for
    this file permission change.
    Thanks,
    Ram.

    You need to correlate any changes on the system to when you have the problem, or see the date on /dev/null change. Software packages can change this, applications can change this, sometimes even patch installs.
    Even certain administrative practices.
    Here's one example, where touching a vendor software-created printer config with native Solaris admintool would change /dev/null permissions
    http://www.rootunix.org/SOLARIS/printFAQ.txt
    10) ONLY ROOT CAN SEND PRINT JOBS:
    This problem is caused by network spooling software that for a
    network printer that uses /dev/null for the printer device. The
    software monitors the queue and spools the print requests over the
    network to the printer. If the printer setup is modified in any
    way with Admintool, the printer device (/dev/null) permissions will
    change to 600 owner lp.

  • /dev/null permissions spontaneously become crw-------

    Every so often, once in a couple of weeks or so, /dev/null spontaneously becomes unreadable and unwriteable for group and others. This happens on my laptop, on VMs and on servers. Only on Archlinux installs. It doesn't happen often enough for me to track down the cause.
    Has anyone else encountered this?
    Could it be a udev issue?

    Yep, encountered it myself. Right now you can either symlink /bin/sh to /bin/zsh (NOT recommended), or use emacs-git from the AUR (fixed in 25.0.50).
    http://lists.gnu.org/archive/html/bug-g … 00980.html
    Last edited by Alad (2015-04-10 15:27:38)

  • Netware - OS X 10.9 Printers Install to file:///dev/null

    SUMMARY: Printers install incorrectly with the iPrint 5.74 client to OS X 10.9.x workstations from an iPrint Manager on Netware 6.5sp8 with the iPrint .8f patch. Their URI is set to file:///dev/null , which makes them appear to operate correctly but no jobs ever reach the printer.
    LONGER VERSION:
    This may be a function of Netware. I have a server running Netware 6.5 sp8 with the iPrint 8f patch and workstations with latest OS X iprint client (5.74). OS X is at 10.9.1. When I install a printer from this server, jobs submitted appear to print correctly but never actually come out of the printer. The iPrint Management web interface shows that no new jobs have been submitted to the printer.
    A packet trace shows no traffic from the workstation to the printer.
    Looking deeper, I see that the OS X iPrint client does NOT list the printer as an iPrint printer in its GUI interface. However, OS X DOES show a printer of the same name as existing. During installation, the iPrint client does give a popup indicating that the printer was installed correctly. When iPrint's trace.txt is examined, the installation of the printer is logged, but not the submission of print jobs to it. The errors.txt file indicates that at least one printer has the URI file:///dev/null but the name of the printer is not indicated.
    When the OS X CUPS interface is examined directly, I find that the printer that was just installed via iPrint does indeed have its URI set to file:///dev/null .
    Machines with OS X 10.8 and below print correctly and are set to the proper ipp URI instead of file:///dev/null. Printers installed from an OES manager are fine even on OS X 10.9. Also, printers that do have the URI problem get otherwise correct information during installation -- they receive correct name, location, and driver.
    The release notes for the 8f iPrint patch for Netware explicitly mention 10.8 compatibility but not 10.9. I see elsewhere that the 8f patch may have been created in response to an Apache hog created by OS X 10.9, so that release is within the calculations of the Dev team (and was already released when the 8f patch appeared). However, it does appear that there is a 10.9-related bug even in the 5.74 client.
    Has anyone else seen this behavior? Is anyone aware of a work-around?
    If anyone is interested in investigating, a can provide lots of logs.
    I have also submitted a bug on this issue via the regular bug reporting page.

    Originally Posted by rdemaster
    I believe I have a the same problem with the iPrint appliance and OS X 10.9. Would be interested in any work around.
    Simon Flood has helpfully pointed me towards the root issue: Space names in the printer cause problems in 10.9. There is now a TID for the issue -- 7014704 -- but no work-around. However, I'm sure there will be a client fix soon.

  • /dev/null link destroyed. Need help

    I have Forms 6i applications deployed on the internet under Oracle 9iAS 1.0.2.2 on Solaris 2.9 64 bits OS.
    I am starting the 9iAS running the command "apachectl startssl" as 'root' because that's the only way I am able to grab port 443. However as soon as any output is redirected to /dev/null, the /dev/null link is broken and replaced by a /dev/null file writable to only by root.
    My question is what can I do to prevent that?

    Steve Walter (guest) wrote:
    : The "Deploying Applications on the WEB" docs are good for
    : release 2.1, but lack all detail in 6.0. Does anyone have a
    : guideline for building a forms cartridge in 6.0. I've
    followed
    : the 2.1 documentation, knowing it is a bit different, but I
    : still can't get it to work.
    : Thanks for any and all help.
    : Steve
    The error I recieve is Can not service this request, Please try
    again later
    null

  • /dev/null changes result, why? ( How to know if svn repository exists )

    Hi,
    Because I am writing last few weeks some scripts for a project, I do want to put those under svn ( subversion ). As a scripting exercise I want to be able to create Repos and project folders in one go and add changes to the repo's svn conf files.
    I want to check if there is already an existing repository and if the name=passw line is already added to the passw db.
    I did use:
    svnlook youngest /Volumes/Development/_svnRepo/SSHToolNew 2>&1 | grep "No such file or directory" -c
    to check for the error message returned by svnlook
    svnlook: Can't open file '/Volumes/Development/_svnRepo/SSHToolNew/format': No such file or directory
    and want to continue doing my stuff when the result is bigger then 0, otherwise create the repo first with some options.
    With the following info
    /Volumes/Development/_svnRepo/SSHTools exists
    /Volumes/Development/_svnRepo/SSHToolNew doesn't exists
    using ( typed in the sh )
    svnlook youngest /Volumes/Development/_svnRepo/SSHToolNew 2>&1 | grep "No such file or directory" -c
    1
    echo "rv:" $?
    1
    gives as result 1 in the shell and when using echo "rv:" $?
    however
    svnlook youngest /Volumes/Development/_svnRepo/SSHToolNew 2>&1 | grep "No such file or directory" -c &> /dev/null
    echo "rv:" $?
    0
    gives 0 as result.
    And when the folder do exists it return the opposite!?
    Just to understands the happening. Why the difference with &> /dev/null ?
    What do I mis here?

    Hi Thanks you for your reply,
    I want that the result goes into a var so that I can compare it in an 'if' statement.
    If I leave & out then I get the following same result
    bash-3.2$ svnlook youngest /Volumes/Development/_svnRepo/SSHToolNew 2>&1 | grep "No such file or directory" -c > /dev/null
    bash-3.2$ echo "rv: "$?
    rv: 0
    It should be one ( 1 ) because the result count is one. Or am I wrong?
    So basicly, why is it changing the result? or is $? not the result of my line?
    What is the best way to check if f.e a command is failed like the one I use in an if statement? Can I move the result directly into a var, something like?
    bash-3.2$ svnlook youngest /Volumes/Development/_svnRepo/SSHToolNew 2>&1 | grep "No such file or directory" -c | MyVar=$? ( or whatever needed )
    Thanks again

  • Problem with /dev/null

    Hi,
    I faced this problem twice and I do not know how to reproduce it.
    There are 2 log files ERRORFILE and EVENTFILE.
    I have a script as show below which takes a backup of the log files,every hour. Processes are continously writing to the log files. Occasianaly(twice till now), I see that the inode of the ERRORFILE and EVENTFILE gets changed, due to this no precesses can write to the log file and they need to be restarted to initiate logging. Is there something worng with the command "cp /dev/null".?
    TIME=`date '+%Y%m%d_%H%M'`
    cp $ERRORFILE $ERRORFILE:$TIME:BACKUP
    cp $EVENTFILE $EVENTFILE:$TIME:BACKUP
    /usr/bin/gzip $ERRORFILE:$TIME:BACKUP
    /usr/bin/gzip $EVENTFILE:$TIME:BACKUP
    cp /dev/null $ERRORFILE
    cp /dev/null $EVENTFILE

    Hi,
    Just to make sure we do not deviate the topic to "/dev/null" getting corrupted.
    The actual concern is that the inode of the log files got changed, even though there was no "mv" or "rm" operation performed on it.
    The problem for which I need your assistance and expertise is to know whether in any scenario a "cp" will change the inode number, say for example, when we are coping from a device character file(/dev/null). I have pasted the snippet of the script below. Could there be some erroneous condition which could lead to such a problem, say for example gzip returned a error or something like that.
    TIME=`date '+%Y%m%d_%H%M'`
    cp $ERRORFILE $ERRORFILE:$TIME:BACKUP
    cp $EVENTFILE $EVENTFILE:$TIME:BACKUP
    /usr/bin/gzip $ERRORFILE:$TIME:BACKUP
    /usr/bin/gzip $EVENTFILE:$TIME:BACKUP
    cp /dev/null $ERRORFILE
    cp /dev/null $EVENTFILEThanks

  • Can I /dev/null my access log while running?

    I have a Directory Server 5.2 system running
    on Linux Red Hat.
    My access log is huge - 1.7 G in 2 days, using
    default logging.
    Can I manage this by copying the access log
    to another directory, then
    cat /dev/null > /sunusr/slapd-xxxx/access
    w/o negative effects ?
    If I can , this will save me much grief,
    JYard
    UCLA

    You can cat /dev/null, but you should not need to. You should be able to configure, the size, the rotation time, and the max file system utilization. You can actually have logs that do not exceed 10MB or whatever you want. Go to the configuration/logs tab in the console and set it any way you want.

  • S10u 7 - smpatch in BE fails - patchadd: /dev/null: cannot create

    Solaris 10 5/09 s10x_u7wos_08 X86 with ZFS Root + Zones
    smpatch on non active BE with Zones fails:
    # smpatch update -b s10x_u7wos_08p1
    Ckecking the currently running boot enviornment ...
    Currently running boot enviornment name is [s10x_u7wos_08p].
    Checking the destination boot environment [s10x_u7wos_08p1] ...
    Installing patches from /var/sadm/spool...
    Copying the currently running BE into inactive BE [s10x_u7wos_08p1] ...
    (This process will take some time, please wait a moment.)
    Installing update(s) onto the inactive boot environment [s10x_u7wos_08p1] ...
    Failed to install patch 119901-07.
    Utility used to install the update failed with exit code 1.
    System has findroot enabled GRUBNo entry for BE <s10x_u7wos_08p1> in GRUB menuValidating the contents of the media </var/sadm/spool/119901-07.jar.dir>.The media contains
    1 software patches that can be added.All 1 patches will be added because you did not specify any specific patches to add.Mounting the BE <s10x_u7wos_08p1>.Adding patche
    s to the BE <s10x_u7wos_08p1>.Validating patches...Loading patches installed on the system...Done!Loading patches requested to install.Done!Checking patches that you spe
    cified for installation.Done!Approved patches will be installed in this order:119901-07 Preparing checklist for non-global zone check...Checking non-global zones...This
    patch passes the non-global zone check.119901-07 Summary for zones:Zone master-templateRejected patches:None.Patches that passed the dependency check:119901-07 Zone mast
    er-template-cloneRejected patches:None.Patches that passed the dependency check:119901-07 Patching global zoneAdding patches...Checking installed patches...Verifying suf
    ficient filesystem capacity (dry run method)...Installing patch packages...Patch 119901-07 has been successfully installed.See /a/var/sadm/patch/119901-07/log for detail
    sPatch packages installed: SUNWPython SUNWTiff SUNWTiff-devel SUNWgnome-img-viewer-shareDone!Patching non-global zones...Patching zone master-templateAdding patches.
    ..Checking installed patches...Patchadd is terminating.Done!Unmounting the BE <s10x_u7wos_08p1>.The patch add to the BE <s10x_u7wos_08p1> failed (with result code <8>).
    /usr/lib/patch/patchadd[4]: /dev/null: cannot create/usr/lib/patch/patchadd[6]: /dev/null: cannot createsort: insufficient available file descriptorsPatch 119901-07 fail
    ed in non-global zone SUNWlu-master-template.Patch 119901-07 wasn't installed in zones:master-template-clone
    Failed to install patch 119901-07.
    ALERT: Failed to install patch 119901-07.
    Any ideas?
    TIA.
    /phs
    Peter H. Seybold

    Post your question in the Developer Forums:
    http://discussions.apple.com/category.jspa?categoryID=164

  • Datapump export to /dev/null

    Using normal export we can export the data to /dev/null as
    exp full=y file=/dev/null log=/home/abc.log
    but can this be done in data pump something like ?
    expdp DIRECTORY=dev TABLES=HDHILLON.T1 DUMPFILE=null
    SQL> select * from dba_directories where DIRECTORY_NAME='DEV';
    OWNER DIRECTORY_NAME DIRECTORY_PATH
    SYS DEV /dev/
    Any help will be appreciated. I want to export the database to /dev/null
    --Harvey
    Edited by: Harvey on Jul 8, 2011 10:47 AM
    Edited by: Harvey on Jul 8, 2011 10:48 AM

    Hi,
    Your solution will only create a file called datafile.dmp but I want to export the data to /dev/null
    I think you know what /dev/null is.
    --Harvey.                                                                                                                                                                                                                                                                                                                               

  • [SOLVED] where is /dev/null ?

    I need to supress "make" output in arch, in debian-based distro I used to make it via "make &> /dev/null" command, but can't find this in arch, where is /dev/null?
    Last edited by tasty_minerals (2011-06-01 19:48:35)

    Huh?
    [karol@black ~]$ ls -al /dev/null
    crw-rw-rw- 1 root root 1, 3 06-01 09:59 /dev/null
    Try sending stdout to stderr
    [karol@black ~]$ echo bum
    bum
    [karol@black ~]$ echo bum 2&>1
    [karol@black ~]$
    Last edited by karol (2011-06-01 19:46:35)

  • [SOLVED] dd doesn't copy from /dev/null

    To compile a large application using IPO I need a lot of memory, more than the 1 GB RAM + 1 GB swap on my system. In order to create an extra (temporary) swap file I need to create a large, empty file. For this purpose I did
    # dd if=/dev/null of=/large_partition/swapfile bs=1K count=1024G
    But dd always returns
    0+0 records in
    0+0 records out
    0 bytes (0 B) copied, 2.7727e-05 s, 0.0 kB/s
    (time may vary.) Copying an ordinary file using dd works as expected.
    What could be wrong (with /dev/null)?
    Last edited by Marcel- (2010-03-31 22:10:42)

    /dev/null is a 'black hole', it discards every data and you can't use it this way. I think you should try /dev/zero instead.

  • DB2 V.8.2. backup /dev/null?

    Hello,
    we will make a sap upgrade from 46C to 47EXT with a 1,7 Terabyte DB2 V.8.2.2 database. We are using as a backup strategy. SAN-Splitt. In the upgrade after activating the logretain and userexit, we are forced to make a backup. We have to trick the database and tell her, that we already have done a backup (over BCV-Splitt). Is there a faster way to make a backup as db2 backup db <SID> to /dev/null?
    Regards,
    Alexander

    Hi Alexander,
    in this case you can use db2dart to turn off backup pending state.
    Best regards, Jens

Maybe you are looking for