[Bug 191869] New: tmux(1) refuses to start via service(8)

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon Jul 14 20:17:36 UTC 2014


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=191869

            Bug ID: 191869
           Summary: tmux(1) refuses to start via service(8)
           Product: Base System
           Version: 9.2-RELEASE
          Hardware: i386
                OS: Any
            Status: Needs Triage
          Severity: Affects Some People
          Priority: ---
         Component: bin
          Assignee: freebsd-bugs at FreeBSD.org
          Reporter: dteske at FreeBSD.org

If building an rc script (either old-style or new) that utilizes tmux, said
rc-script functions as-desired if executed directly (e.g., typing
"/etc/rc.d/foo start") but does not function as-desired -- producing the
following error -- if instead executed via service(8) (/usr/sbin/service):

open terminal failed: terminal does not support clear

The issue is with line 142 of usr.sbin/service/service.sh (revision 267493)
which reads as follows:

exec env -i HOME=/ PATH=/sbin:/bin:/usr/sbin:/usr/bin $dir/$script $*

The issue here is the purposeful use of the "-i" flag to env(1) which tells
/usr/bin/env to (quote) "execute the utility with only those environment
variables specified by name=value options. The environment inherited by env is
ignored completely."

Specifically, it is the absence of the TERM environment variable that causes
tmux to produce the above error ("open terminal failed: terminal does not
support clear").

The solution is to add TERM to the list of variables provided to (in this case)
the child tmux. Globally adding TERM to the list of variables that are passed
to service(8) child-scripts seems harmless enough (warranted even; for pedantic
properness).

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list