Re: daily(8) deletes XDG_RUNTIME_DIR

Jeremie Courreges-Anglas <[email protected]> Mon, 1 Jun 2026 19:55:18 +0200
Newsgroups gmane.os.openbsd.bugs
Message-ID <[email protected]>
On Mon, Jun 01, 2026 at 06:08:58AM +0000, [email protected] wrote:
> > -	    ! -path ./.ICE-unix ! -path ./run/user ! -name . \
> > +	    ! -path ./.ICE-unix ! -path './run/user/*' ! -name . \
> 
> Don't delete ./run/user if it's empty.

I think this diff below is the correct fix.  We don't want to delete
/tmp/run/user or /tmp/run/user/1000 once they have been created.  We
can't delete the latter even if it doesn't contain any file/subdir,
since the user might still be connected in a session with
XDG_RUNTIME_DIR set in the environment.

I'll commit this soonish unless I hear otherwise, oks welcome too.

> Index: etc/daily
> ===================================================================
> RCS file: /cvs/src/etc/daily,v
> diff -u -p -u -r1.102 daily
> --- etc/daily	14 Nov 2025 10:08:10 -0000	1.102
> +++ etc/daily	1 Jun 2026 04:37:01 -0000
> @@ -52,8 +52,8 @@ if [ -d /tmp -a ! -L /tmp ]; then
>  		-o -path './tmux-*' \) -prune -o \
>  	    -type f -and ! -path './*.s[eh]m' -atime +7 -delete 2>/dev/null
>  	find -x . -type d -mtime +1 ! -path ./vi.recover ! -path ./.X11-unix \
> -	    ! -path ./.ICE-unix ! -path ./run/user ! -name . \
> -	    -delete >/dev/null 2>&1; }
> +	    ! -path ./.ICE-unix ! -path ./run/user ! -path './run/user/*' \
> +	    ! -name . -delete >/dev/null 2>&1; }
>  fi
>  
>  # Additional junk directory cleanup would go like this:
> 

-- 
jca