Bug#955570: tor: Option NICE not used from /etc/default/tor

2020-04-02 Thread Harri Suutari
On Thu, Apr 02, 2020 at 07:58:58PM +0200, intrigeri wrote:
> /etc/default/tor also reads:
> 
>   # Note that this file is not being used for controlling Tor-startup
>   # when Tor is launched by systemd.
> 
> So with systemd, I think you need to use LimitNICE=
> (systemd.exec(5) manpage) in a drop-in override,
> that you can generate for example with "systemctl edit".

I missed that note because in my system it was in
the newer /etc/default/tor.dpkg-dist version that
I had selected not to use in the latest upgrade.

Thanks for pointing in the right direction, systemd.
I got the NICE level set, so let's ducument it here
for everybody to see:


# systemctl edit tor@default.service
(Note: editing tor.service does not work, I tried.)

Text editor opens... put there:
[Service]
Nice=18

Save... it is saved as 
/etc/systemd/system/tor@default.service.d/override.conf

Restart service:
# systemctl restart tor@default.service
or
# service tor@default restart
or
# /etc/init.d/tor restart


And the priority of the process is now lower (nice).
-- 


  Harri



Bug#955570: tor: Option NICE not used from /etc/default/tor

2020-04-02 Thread intrigeri
Hi,

Harri Suutari (2020-04-02):
> set, but the nicelevel is not used by the tor process.

/etc/default/tor also reads:

  # Note that this file is not being used for controlling Tor-startup
  # when Tor is launched by systemd.

So with systemd, I think you need to use LimitNICE=
(systemd.exec(5) manpage) in a drop-in override,
that you can generate for example with "systemctl edit".

Cheers!



Bug#955570: tor: Option NICE not used from /etc/default/tor

2020-04-02 Thread Harri Suutari
Package: tor
Version: 0.3.5.10-1
Severity: normal

File /etc/default/tor has

# If tor is seriously hogging your CPU, taking away too much cycles from
# other system resources, then you can renice tor.  See nice(1) for a
# bit more information.  Another way to limit the CPU usage of an Onion
# Router is to set a lower BandwidthRate, as CPU usage is mostly a function
# of the amount of traffic flowing through your node.  Consult the torrc(5)
# manual page for more information on setting BandwidthRate.
#
NICE="--nicelevel 17"

set, but the nicelevel is not used by the tor process.




-- System Information:
Debian Release: 10.3
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: i386 (x86_64)
Foreign Architectures: amd64

Kernel: Linux 4.19.0-8-amd64 (SMP w/4 CPU cores)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_DK.utf8, LC_CTYPE=fi_FI.UTF-8 (charmap=UTF-8),
LANGUAGE=en_DK.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages tor depends on:
ii  adduser 3.118
ii  libc6   2.28-10
ii  libcap2 1:2.25-2
ii  libevent-2.1-6  2.1.8-stable-4
ii  liblzma55.2.4-1
ii  libseccomp2 2.3.3-4
ii  libssl1.1   1.1.1d-0+deb10u2
ii  libsystemd0 241-7~deb10u3
ii  libzstd11.3.8+dfsg-3
ii  lsb-base10.2019051400
ii  zlib1g  1:1.2.11.dfsg-1

Versions of packages tor recommends:
ii  logrotate3.14.0-4
ii  tor-geoipdb  0.3.5.10-1
ii  torsocks 2.3.0-2

Versions of packages tor suggests:
ii  apparmor-utils   2.13.2-10
pn  mixmaster
pn  obfs4proxy   
ii  socat1.7.3.2-2
ii  tor-arm  2.1.0-2
ii  torbrowser-launcher  0.3.2-7~bpo10+1

-- Configuration Files:
/etc/default/tor changed [not included]
/etc/tor/torrc changed [not included]