Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

samba: fix autostart service #41841

Merged
merged 1 commit into from Oct 12, 2019
Merged

samba: fix autostart service #41841

merged 1 commit into from Oct 12, 2019

Conversation

Izorkin
Copy link
Contributor

@Izorkin Izorkin commented Jun 11, 2018

Motivation for this change

Fixes of automatic samba startup during server bootup

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@xeji
Copy link
Contributor

xeji commented Jun 11, 2018

samba.target, which starts these services, already starts after network.target:

  systemd = {
          targets.samba = {
            description = "Samba Server";
            requires = [ "samba-setup.service" ];
            after = [ "samba-setup.service" "network.target" ];
            wantedBy = [ "multi-user.target" ];
};

I don't understand how repeating this in the individual services makes a difference.

@Izorkin
Copy link
Contributor Author

Izorkin commented Jun 11, 2018

default generated config samba-smbd.service -

[Unit]
Description=Samba Service Daemon smbd
PartOf=samba.target
X-Restart-Triggers=/nix/store/hfjp39xq19b3h4h8y9vrxjabp0q15rnz-smb.conf

[Service]
Environment="LD_LIBRARY_PATH=/nix/store/c5wlvh9g9xxh4wca6l1klj1clxifz9qh-systemd-238/lib"
Environment="LOCALE_ARCHIVE=/run/current-system/sw/lib/locale/locale-archive"
Environment="PATH=/nix/store/jy9knxp7nmw80jkf932axrs1b4p9k4hi-coreutils-8.29/bin:/nix/store/n7km6qpl46bd9lkvf9cvzwv6gks7szls-findutils-4.6.0/bin:/nix/store/z2g1kvn7rflq65y5j2ayd7xp7gvbhdi2-gnugrep-3.1/bin:/nix/store/p844gl2lb267aii2jdv5bqx4ph68l25m-gnused-4.4/bin:/nix/store/c5wlvh9g9xxh4wca6l1klj1clxifz9qh-systemd-238/bin:/nix/store/jy9knxp7nmw80jkf932axrs1b4p9k4hi-coreutils-8.29/sbin:/nix/store/n7km6qpl46bd9lkvf9cvzwv6gks7szls-findutils-4.6.0/sbin:/nix/store/z2g1kvn7rflq65y5j2ayd7xp7gvbhdi2-gnugrep-3.1/sbin:/nix/store/p844gl2lb267aii2jdv5bqx4ph68l25m-gnused-4.4/sbin:/nix/store/c5wlvh9g9xxh4wca6l1klj1clxifz9qh-systemd-238/sbin"
Environment="TZDIR=/nix/store/1baqg9dabp6jcr1p589mv2xgbgrknly8-tzdata-2018e/share/zoneinfo"



ExecReload=/nix/store/jy9knxp7nmw80jkf932axrs1b4p9k4hi-coreutils-8.29/bin/kill -HUP $MAINPID
ExecStart=/nix/store/l6z2i63dhckjig3snvf11bq2f040a7a0-samba-4.7.6/sbin/smbd --foreground --no-process-group
LimitNOFILE=16384
NotifyAccess=all
PIDFile=/run/smbd.pid
Type=notify

Service not start after network.target

 samba-smbd.service - Samba Service Daemon smbd
   Loaded: loaded (/nix/store/hrzfnd1yi0nhfainyipdaha70xjjld63-unit-samba-smbd.service/samba-smbd.service; enabled; vendor preset: enabled)
   Active: failed (Result: signal) since Mon 2018-06-11 16:41:55 MSK; 4h 29min ago
  Process: 1520 ExecStart=/nix/store/9gyvdc0l9k976m9f9b70sr86658b7897-samba-4.7.6/sbin/smbd --foreground --no-process-group (code=killed, signal=ABRT)
 Main PID: 1520 (code=killed, signal=ABRT)
   Status: "smbd: ready to serve connections..."

июн 11 16:41:52 NixOS-VMWare systemd[1]: Starting Samba Service Daemon smbd...
июн 11 16:41:55 NixOS-VMWare systemd[1]: Started Samba Service Daemon smbd.
июн 11 16:41:55 NixOS-VMWare systemd[1]: ^[[0;1;39m^[[0;1;39msamba-smbd.service: Main process exited, code=killed, status=6/ABRT
июн 11 16:41:55 NixOS-VMWare systemd[1]: ^[[0;1;39m^[[0;1;39msamba-smbd.service: Failed with result 'signal'.

@mmahut
Copy link
Member

mmahut commented Aug 3, 2019

What is the status of this pull request?

@Izorkin
Copy link
Contributor Author

Izorkin commented Aug 3, 2019

@mmahut actual

@joachifm joachifm merged commit a8b2e30 into NixOS:master Oct 12, 2019
@Izorkin Izorkin deleted the samba branch October 12, 2019 17:36
@Izorkin
Copy link
Contributor Author

Izorkin commented Oct 12, 2019

@joachifm checked samba with this update. This variant used to work, now - not working.

окт 13 00:16:26 elven.pw smbd[4299]: ^[[0;1;39m[2019/10/13 00:16:26.447867,  0] ../../source3/lib/interface.c:652(load_interfaces)
окт 13 00:16:26 elven.pw smbd[4299]: ^[[0;1;39m  WARNING: no network interfaces found
окт 13 00:16:26 elven.pw smbd[4299]: ^[[0;1;39m[2019/10/13 00:16:26.943689,  0] ../../lib/util/become_daemon.c:136(daemon_ready)
окт 13 00:16:26 elven.pw smbd[4299]: ^[[0;1;39m  daemon_ready: daemon 'smbd' finished starting up and ready to serve connections
окт 13 00:16:26 elven.pw smbd[4299]: ^[[0;1;39m[2019/10/13 00:16:26.943798,  0] ../../source3/smbd/server.c:1298(open_sockets_smbd)
окт 13 00:16:26 elven.pw smbd[4299]: ^[[0;1;39m  open_sockets_smbd: No sockets available to bind to.
окт 13 00:16:26 elven.pw smbd[4299]: ^[[0;1;39m[2019/10/13 00:16:26.944074,  0] ../../source3/lib/util.c:824(smb_panic_s3)
окт 13 00:16:26 elven.pw smbd[4299]: ^[[0;1;39m  PANIC (pid 4299): open_sockets_smbd() failed
окт 13 00:16:26 elven.pw smbd[4299]: ^[[0;1;39m[2019/10/13 00:16:26.962405,  0] ../../lib/util/fault.c:261(log_stack_trace)
окт 13 00:16:26 elven.pw smbd[4299]: ^[[0;1;39m  BACKTRACE: 9 stack frames:
окт 13 00:16:26 elven.pw smbd[4299]: ^[[0;1;39m   #0 /nix/store/6c2fqjzcl238a1990ldcvi0zjcga7368-samba-4.10.8/lib/libsamba-util.so.0(log_stack_trace+0x32) [0x7278b091b002]
окт 13 00:16:26 elven.pw smbd[4299]: ^[[0;1;39m   #1 /nix/store/6c2fqjzcl238a1990ldcvi0zjcga7368-samba-4.10.8/lib/libsmbconf.so.0(smb_panic_s3+0x18) [0x7278b02361f8]
окт 13 00:16:26 elven.pw smbd[4299]: ^[[0;1;39m   #2 /nix/store/6c2fqjzcl238a1990ldcvi0zjcga7368-samba-4.10.8/lib/libsamba-util.so.0(smb_panic+0x2d) [0x7278b091b10d]
окт 13 00:16:26 elven.pw smbd[4299]: ^[[0;1;39m   #3 /nix/store/6c2fqjzcl238a1990ldcvi0zjcga7368-samba-4.10.8/lib/samba/libsmbd-base-samba4.so(+0x165f0e) [0x7278b06ebf0e]
окт 13 00:16:26 elven.pw smbd[4299]: ^[[0;1;39m   #4 /nix/store/6c2fqjzcl238a1990ldcvi0zjcga7368-samba-4.10.8/lib/samba/libsmbd-base-samba4.so(+0x166273) [0x7278b06ec273]
окт 13 00:16:26 elven.pw smbd[4299]: ^[[0;1;39m   #5 /nix/store/6c2fqjzcl238a1990ldcvi0zjcga7368-samba-4.10.8/lib/samba/libsmbd-shim-samba4.so(exit_server+0x14) [0x7278af92a294]
окт 13 00:16:26 elven.pw smbd[4299]: ^[[0;1;39m   #6 /nix/store/6c2fqjzcl238a1990ldcvi0zjcga7368-samba-4.10.8/sbin/smbd(main+0x1365) [0x5bfc76b42375]
окт 13 00:16:26 elven.pw smbd[4299]: ^[[0;1;39m   #7 /nix/store/6yaj6n8l925xxfbcd65gzqx3dz7idrnn-glibc-2.27/lib/libc.so.6(__libc_start_main+0xee) [0x7278af0bbb8e]
окт 13 00:16:26 elven.pw smbd[4299]: ^[[0;1;39m   #8 /nix/store/6c2fqjzcl238a1990ldcvi0zjcga7368-samba-4.10.8/sbin/smbd(_start+0x2a) [0x5bfc76b42e0a]
окт 13 00:16:26 elven.pw smbd[4299]: ^[[0;1;39m[2019/10/13 00:16:26.962547,  0] ../../source3/lib/dumpcore.c:318(dump_core)
окт 13 00:16:26 elven.pw smbd[4299]: ^[[0;1;39m  coredump is handled by helper binary specified at /proc/sys/kernel/core_pattern

Need revert PR?

@joachifm
Copy link
Contributor

Sure. I got the impression this had been tested.

@Izorkin
Copy link
Contributor Author

Izorkin commented Oct 13, 2019

worked a year ago)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants