From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 911 invoked from network); 8 Sep 2020 16:54:07 -0000 Received: from alyss.skarnet.org (95.142.172.232) by inbox.vuxu.org with ESMTPUTF8; 8 Sep 2020 16:54:07 -0000 Received: (qmail 32304 invoked by uid 89); 8 Sep 2020 16:54:30 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Received: (qmail 32297 invoked from network); 8 Sep 2020 16:54:29 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=scolby.com; h= mime-version:message-id:date:from:to:subject:content-type; s= fm2; bh=JWu2iVIeX9+2hFYrzdPfVzLW/L6XqhKJFxIwFdRqxGM=; b=K125oPyn pruCphrDW9apHgqKf89PkHSSufNacP3v3LMR/PHmHCz4hTVZMhgoiVUlszTILfW8 IzJJBAhAXI8eiaVgLW/YwE1Ip3RFYSAykxuah9FDtcdfD+fWs08ZLGHJJRB+VV2b un8Yz48UYeJYy72fl3CtvkWyibzprqq6VXfl+p95hgV85b1DPykR35U4YK2duvGH fHz5ApIu3YNjoujalARnEqaSBFqRlayGEi9x+swHZEdXKeZsRUSOCmaL75dnX//I Zy8tDXs0tqdOZtdw875GZtmUU4sXsd6MfMhzs+MbS6qvGGZcp4XVbz4fJvzwXpkK 5RLMpFyKJNXfLA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=JWu2iVIeX9+2hFYrzdPfVzLW/L6Xq hKJFxIwFdRqxGM=; b=YXsMqpe+amgHeGADQqeqcGu96cGUA2re6n4LmeGbja74u GgOyPjPID2YAY2alY4/ToPPpwpU1qDT+4B85Kz7p2xm8n4yMzk4uVZ1gRraBnBN9 NhBt3AyoBQM2qt9VQFKbK+mIegylNq+TDaUbFksDrA5RfHgkkwA5YkNcQ7IGp1Ge SncIYTZt5fwB14cdU0bFsTo/je0e8oW7ByDCxMC3RrTmiGLrvNO4KttS/pHX4pcW OUviG6GE9Z4/Hr3zU6zquk+Gwq9Om53ovxHfEt4tYC5zFsYpDUnp9oI8GpeeIKjf 4Wpk7oQK1NMMh0I141gfDytwoiGPLy9Mgmt2AS9Rw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudehfedgledtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfffhffvufgtsehttdertd erredtnecuhfhrohhmpedfufgtohhtthcuveholhgshidfuceoshgtohhtthesshgtohhl sgihrdgtohhmqeenucggtffrrghtthgvrhhnpeevvdevffetvdetveeftefhkeejgfdvte eiuedtgfevleduffetjeelhfelffejtdenucevlhhushhtvghrufhiiigvpedtnecurfgr rhgrmhepmhgrihhlfhhrohhmpehstghothhtsehstgholhgshidrtghomh X-ME-Proxy: X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.3.0-259-g88fbbfa-fm-20200903.003-g88fbbfa3 Mime-Version: 1.0 Message-Id: Date: Tue, 08 Sep 2020 12:53:37 -0400 From: "Scott Colby" To: supervision@list.skarnet.org Subject: Understanding the syslogd-linux Service Script Content-Type: text/plain Hello, I am faced with running a program in a container that will only log to syslog and cannot be configured otherwise. I am looking to using s6 within the container to supervise this program and some implementation of syslog. I thought that there must be something simpler than rsyslog or syslog-ng, and my investigations led me to the s6/examples/syslogd-linux service directory. I am only slightly experienced with writing execline scripts and would like to better understand exactly what each line in the example run script is doing. Here it is, annotated with my understanding and questions. #!/command/execlineb -P # Redirects stderr to stdout, but why is this necessary? fdmove -c 2 1 # Clears the environment, I assume for general # security/isolation/cleanliness reasons? exec -c # Prepares for setting uid/gid later s6-envuidgid nobody # Redirects stdout to fd 3, I think because s6-ipcserver closes fd # 1; what happens to things sent to fd 3? # Also, why is the -c option not used here? fdmove 1 3 # Listens on /dev/log, this makes sense to me s6-ipcserver -U -1 -- /dev/log # Redirects stdout to stderr, because this is where log messages # are expected to go fdmove -c 1 2 # writes stdin to stdout with the values of the remote UID and GID # prepended, plus whatever other functionality of ucspidlogd ucspilogd IPCREMOTEEUID IPCREMOTEEGID Please let me know if I have made any mistakes in my annotation and what the answers to my questions are. Thank you, Scott