midchildan commented on a change in pull request #7697:
URL: https://github.com/apache/trafficserver/pull/7697#discussion_r611221287



##########
File path: config.layout
##########
@@ -277,3 +277,23 @@
     logdir:        /var/log+
     cachedir:      /var/lib+
 </Layout>
+
+<Layout NixOS>
+    prefix:        /opt/trafficserver
+    exec_prefix:   ${prefix}
+    bindir:        ${exec_prefix}/bin
+    sbindir:       ${exec_prefix}/sbin
+    libdir:        ${exec_prefix}/lib
+    libexecdir:    ${exec_prefix}/libexec
+    infodir:       ${prefix}/share/info
+    mandir:        ${prefix}/share/man
+    sysconfdir:    /etc+
+    datadir:       ${prefix}/share+
+    docdir:        ${prefix}/share/doc+
+    installbuilddir: ${datadir}/build
+    includedir:    ${prefix}/include
+    localstatedir: /var/lib+
+    runtimedir:    /run+
+    logdir:        /var/log+
+    cachedir:      /var/cache+
+</Layout>

Review comment:
       About half of these are replaced through configure flags when building 
with Nix, but I still added them for the sake of consistency.

##########
File path: tools/tsxs.in
##########
@@ -204,6 +204,9 @@ do
                OBJ=$OPTARG
                ;;
        i)
+               if [[ "$INSTALLDIR" = /nix/store* ]]; then
+                       bail "unsupported option: -i is disabled on Nix"
+               fi

Review comment:
       `/nix/store` is where packages are installed and is non-writable.

##########
File path: rc/trafficserver.service.in
##########
@@ -17,7 +17,7 @@
 #
 [Unit]
 Description=Apache Traffic Server is a fast, scalable and extensible caching 
proxy server.
-After=syslog.target network.target
+After=network.target

Review comment:
       `syslog.target` is [removed from recent versions of 
systemd](https://github.com/systemd/systemd/blob/1cee1c52833fb6e3829e510109404852a17e5bdd/NEWS#L8931).

##########
File path: rc/trafficserver.service.in
##########
@@ -26,10 +26,7 @@ ExecStart=@exp_bindir@/traffic_manager $TM_DAEMON_ARGS
 Restart=on-failure
 RestartSec=5s
 LimitNOFILE=1000000
-ExecStopPost=/bin/sh -c ' \
-        export TM_PIDFILE=$(@exp_bindir@/traffic_layout 2>/dev/null | grep 
RUNTIMEDIR | cut -d: -f2)/manager.lock ; \
-        /bin/rm $TM_PIDFILE ; \
-        if [[ $? -ne 0 ]]; then echo "ERROR: Unable to delete PID"; exit 1; fi'
+PIDFile=@exp_runtimedir@/manager.lock

Review comment:
       Using `PIDFile` to clean up PID files is slightly more portable, as some 
distros don't have `/bin/rm`.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to