Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command 'install' exits with unexpected error: install: link: ... to ...: File exists #3

Closed
wq9578 opened this issue Oct 7, 2024 · 1 comment

Comments

@wq9578
Copy link

wq9578 commented Oct 7, 2024

The utility install claims that a file exists although it didn't exist before.
In a shell script install is called with a filename argument based on a UTC timestamp:

ls -al /etc/chrony.conf.utc_*

-rw-r--r--  1 root  wheel  3806 Oct  7 01:47 /etc/chrony.conf.utc_2024_10_06_235200.bak
-rw-r--r--  1 root  wheel  3814 Oct  7 01:52 /etc/chrony.conf.utc_2024_10_06_235309.bak

install -bCSv -B .utc_2024_10_06_235355.bak -o root -g wheel -m u=rw,go=r /my/path/chrony.conf /etc/chrony.conf

install: /etc/chrony.conf -> /etc/chrony.conf.utc_2024_10_06_235355.bak
Error: a command has a non-zero exit status
install: link: /etc/chrony.conf to /etc/chrony.conf.utc_2024_10_06_235355.bak: File exists

My guess is that there might be an implementation problem when combining the options -b (backup) and -S (safe copy), such that the file is created by the utility itself, causing a collision.
The source used by current macOS 15.0.1 is taken from the FreeBSD source tree with the last commit here.
This line is the nearest code point I could find.

@markjdb
Copy link
Owner

markjdb commented Oct 7, 2024

This isn't the right place to report a MacOS bug.

@markjdb markjdb closed this as completed Oct 7, 2024
markjdb pushed a commit that referenced this issue Dec 5, 2024
Avoid calling _callout_stop_safe with a non-sleepable lock held when
detaching by initializing callout_init_rw() with CALLOUT_SHAREDLOCK.

It avoids the following WITNESS warning when stopping the service:

    # service ipfilter stop
    calling _callout_stop_safe with the following non-sleepable locks held:
    shared rw ipf filter load/unload mutex (ipf filter load/unload mutex) r = 0 (0xffff0000417c7530) locked @ /usr/src/sys/netpfil/ipfilter/netinet/fil.c:7926
    stack backtrace:
    #0 0xffff00000052d394 at witness_debugger+0x60
    #1 0xffff00000052e620 at witness_warn+0x404
    #2 0xffff0000004d4ffc at _callout_stop_safe+0x8c
    #3 0xffff0000f7236674 at ipfdetach+0x3c
    #4 0xffff0000f723fa4c at ipf_ipf_ioctl+0x788
    #5 0xffff0000f72367e0 at ipfioctl+0x144
    #6 0xffff00000034abd8 at devfs_ioctl+0x100
    #7 0xffff0000005c66a0 at vn_ioctl+0xbc
    #8 0xffff00000034b2cc at devfs_ioctl_f+0x24
    #9 0xffff0000005331ec at kern_ioctl+0x2e0
    #10 0xffff000000532eb4 at sys_ioctl+0x140
    #11 0xffff000000880480 at do_el0_sync+0x604
    #12 0xffff0000008579ac at handle_el0_sync+0x4c

PR:		282478
Suggested by:	markj
Reviewed by:	cy
Approved by:	emaste (mentor)
MFC after:	1 week
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants