Bug 225985 - x11/xdm missing a rc service: submitting a simple tested draft
Summary: x11/xdm missing a rc service: submitting a simple tested draft
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Chris Rees
URL: https://forums.freebsd.org/threads/xd...
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-17 13:12 UTC by Sensucht94
Modified: 2020-01-08 16:29 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (x11)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sensucht94 2018-02-17 13:12:09 UTC
Hi, 
along with some other XDM users, I noticed the x11/xdm package does not extract a rc script in /usr/local/etc/rc.d, hence it's mandatory to enable an netry in /etc/ttys no start XDM at login by default. I'm currently using a simple service I created myself (tested and working), you may want to revise it and include something similar  in the official XDM port.

My XDM a service is defined as follows:


Thursday at 11:41 AM#2
forquare said:
I've noted that there is no xdm service file in any of the rc.d directories I can find (in /etc/rc.d and /usr/local/etc/rc.d) on either of the machines I've tried...Is there something additional I need to install?
Hi, finally another XDM user!
I usually start it from /etc/ttys as per default, turning on the 8th entry, I've never attempted to start as rc service, nad I can confirmx11/xdm port doesn't extract any script inside /usr/local/etc/rc.d, and on the other had, it seems there's no default xdm service in FreeBSD, otherwise rc.conf(5) would have mentioned it, and it doesn't; also see this thread on freebbsd-questions mailing list. Hence, is it possible SirDice had forgotten about having made his own script when he stated so?
Anyway I suppose you could safely make one as well...I'm far less competent than you here, but something like:
Code:



#!/bin/sh

. /etc/rc.subr

# PROVIDE: xdm
# REQUIRE: DAEMON LOGIN FILESYSTEMS moused
# KEYWORD: nojail shutdown

name=xdm
rcvar=${name}_enable
command="/usr/local/bin/${name}"
command_args="-nodaemon"
pidfile="/var/run/${name}.pid"
required_files="/usr/local/etc/X11/xdm/xdm-config"
export PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin"

load_rc_config $name
run_rc_command "$1"
Comment 1 Tobias Kortkamp freebsd_committer freebsd_triage 2018-04-02 14:41:05 UTC
This script is broken and blocks the boot process when enabled. Pending further
investigation on the forums.
Comment 2 Tobias Kortkamp freebsd_committer freebsd_triage 2018-10-11 15:01:48 UTC
Closing it as nobody seems to be interested in fixing it.
Comment 3 Chris Rees freebsd_committer freebsd_triage 2020-01-08 16:07:14 UTC
I'll put one in.
Comment 4 commit-hook freebsd_committer freebsd_triage 2020-01-08 16:29:10 UTC
A commit references this bug:

Author: crees
Date: Wed Jan  8 16:29:08 UTC 2020
New revision: 522434
URL: https://svnweb.freebsd.org/changeset/ports/522434

Log:
  Add simple rc script for xdm.

  All of the other display managers have one, and it saves user
  confusion to have this method available too.

  PR:		ports/225985
  Submitted by:	edmonddantes@gmx.us (based on)

Changes:
  head/x11/xdm/Makefile
  head/x11/xdm/files/xdm.in
Comment 5 Chris Rees freebsd_committer freebsd_triage 2020-01-08 16:29:19 UTC
XDM script committed to ports.  Thanks for the starting rc script-- apart from -nodaemon it was fine, although you can use devel/rclint for hints on how to format it correctly and required_files isn't really necessary as the config file is installed by the port and doesn't crash xdm if it doesn't exist.

Thanks!