🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #89691

Re: innd: SERVER cant open /var/www/inn/inn_status.html: Permission denied

#89691
From: Jeffery Small
Date: Thu, 06 Oct 2022 03:09
94 lines
4646 bytes
On Tuesday, October 4, 2022 at 1:24:01 PM UTC-7, Russ Allbery wrote:
> > I believe you are correct that this is an unrelated issue, and I will 
> > look into it further. That brings us back to the original problem....
> Oh, what does /lib/systemd/system/inn2.service look like? I bet that innd 
> is now started with systemd following your upgrade and probably has 
> various security features enabled, and you're getting bitten by the fact 
> that /var/www is a symlink off to some other file system and that file 
> system probably isn't set up to be writable by the innd process. 
> 
> If something like ProtectSystem=strict is set in that file, you may need 
> to create a directory named /etc/systemd/system/inn2.service.d and drop a 
> file in there named something like www.conf and containing: 
> 
> [Service] 
> ReadWritePaths=/var/www/inn 
> 
> to whitelist an additional writable path. I think it will automatically 
> resolve symlinks; if not, you may need: 
> 
> [Service] 
> ReadWritePaths=/x/u/www

Russ:

Just a quick follow-up.  I tried your suggestions but unfortunately, it didn't work.  Below I'll list the primary systemd inn2.service file as well as my addition.  I did add multiple directory paths and reloaded the daemon and restarted inn2.  Still I get a stream of errors.  ProtectSystem is set to full.  I'm new to systemd and have been attacking it piecemeal.  I'm going to read up on the whole thing so I have a better understanding of what's going on.  In the meantime, any further suggestions are always welcome.

% cat /usr/lib/systemd/system/inn2.service
[Unit]
Description=InterNetNews
Documentation=man:innd(8)
After=network-online.target
Wants=network-online.target

[Service]
Type=notify
Restart=on-abort
ExecStart=/usr/lib/news/bin/rc.news
ExecStop=/usr/lib/news/bin/rc.news stop
ExecReload=/usr/sbin/ctlinnd -t 20 reload all 'by systemd'
User=news
Group=news
ConfigurationDirectory=news
LogsDirectory=news
LogsDirectoryMode=775
RuntimeDirectory=news
StateDirectory=news
StateDirectoryMode=775
ReadWritePaths=/var/spool/news/
ProtectSystem=full
ProtectControlGroups=yes
ProtectHome=yes
# These directives are not compatible with innbind (or postdrop from Postfix)
# because they automatically enable NoNewPrivileges:
# PrivateDevices=yes
# ProtectClock=yes
# ProtectHostname=yes
# ProtectKernelLogs=yes
# ProtectKernelModules=yes
# ProtectKernelTunables=yes
# RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
# RestrictNamespaces=yes
# RestrictRealtime=yes
# RestrictSUIDSGID=yes
# LockPersonality=yes
# MemoryDenyWriteExecute=yes
# SystemCallArchitectures=native
# SystemCallErrorNumber=EPERM
# SystemCallFilter=@system-service
LimitNOFILE=infinity

[Install]
WantedBy=multi-user.target

$ cat /etc/systemd/system/inn2.service.d/www.conf
[Service]
ReadWritePaths=\
  /var/www/ \
  /var/www/inn/ \
  /x/u/www/ \
  /x/u/www/inn/
Technical Details
Message-ID: <aecf2f19-92ee-4c4f-9334-763ad2375d0bn@googlegroups.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
References: <1fa7c51d-79c0-4411-bb01-1a01bc6ea891n@googlegroups.com> <874jwjsj66.fsf@hope.eyrie.org> <b6710de6-919f-4331-a663-b18eaed4346an@googlegroups.com> <87r0znqzj9.fsf@hope.eyrie.org> <f129b02c-cd9c-409d-b88f-8053d62f14e2n@googlegroups.com> <87edvnqqvz.fsf@hope.eyrie.org>

Show Full Headers
Complete Article Headers
Message-ID: <aecf2f19-92ee-4c4f-9334-763ad2375d0bn@googlegroups.com>
Subject: Re: innd: SERVER cant open /var/www/inn/inn_status.html: Permission denied
Date: Thu, 06 Oct 2022 03:09:23 +0000
From: Jeffery Small <jefferysmall@gmail.com>
References: <1fa7c51d-79c0-4411-bb01-1a01bc6ea891n@googlegroups.com> <874jwjsj66.fsf@hope.eyrie.org> <b6710de6-919f-4331-a663-b18eaed4346an@googlegroups.com> <87r0znqzj9.fsf@hope.eyrie.org> <f129b02c-cd9c-409d-b88f-8053d62f14e2n@googlegroups.com> <87edvnqqvz.fsf@hope.eyrie.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
X-Received: by 2002:a0c:9a4e:0:b0:4b1:d537:c6b9 with SMTP id q14-20020a0c9a4e000000b004b1d537c6b9mr1412546qvd.3.1665025763730; Wed, 05 Oct 2022 20:09:23 -0700 (PDT)
X-Received: by 2002:a81:b045:0:b0:329:5160:41a7 with SMTP id x5-20020a81b045000000b00329516041a7mr2710242ywk.306.1665025763458; Wed, 05 Oct 2022 20:09:23 -0700 (PDT)
Newsgroups: news.software.nntp
In-Reply-To: <87edvnqqvz.fsf@hope.eyrie.org>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:600:9100:5ca0:e23f:49ff:fee8:1a31; posting-account=HkkpOQkAAADsR9HpuB7NpuJa7KNw-XVw
Nntp-Posting-Host: 2601:600:9100:5ca0:e23f:49ff:fee8:1a31
User-Agent: G2/1.0
Mime-Version: 1.0
Injection-Date: Thu, 06 Oct 2022 03:09:23 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 94