Commit Graph

14 Commits

Author SHA1 Message Date
Peca Nesovanovic 7c3f86430e p910nd: fix running multiple instances
Compile tested: (ramips, rb760igs, 23.05 snapshot)
Run tested: (ramips, rb760igs, 23.05 snapshot, tests done)

Description:
In case we have multiple device defined in /etc/config/p910nd then init script will try to start multiple instance with same instance name
drop instance name as resolution

tested on 23.05 snapshot with 2 USB printers

Signed-off-by: Peca Nesovanovic <peca.nesovanovic@sattrakt.com>
(cherry picked from commit 152d80ce13)
2024-03-27 14:33:04 +08:00
Paul Donald 4099d99a1a p910nd: init: check device (/dev/usb/lpX) existence
this prevents the daemon exiting when a configured device
is not plugged in.

Signed-off-by: Paul Donald <newtwen@gmail.com>
(cherry picked from commit 4d461aacca)
2024-02-15 00:05:59 +01:00
Paul Donald b5b755a736 p910nd: init: partial fix for openwrt/packages#10496
Harmless to carry this fix until procd.sh adds the param

This parameter will mean umdns advertises not just "OpenWrt" but a more
appropriate string:

"Apple LaserWriter Pro 630"

Signed-off-by: Paul Donald <newtwen@gmail.com>
(cherry picked from commit 60be001775)
2024-02-15 00:05:59 +01:00
Paul Donald f946b2e4bf p910nd: hotplug+init: include extra ieee1284 properties
Apple and macOS GUI co-opts the mDNS note= param as "Location"

Signed-off-by: Paul Donald <newtwen@gmail.com>
(cherry picked from commit c74f82e17b)
2024-02-15 00:05:59 +01:00
Paul Donald 12c0db6867 p910nd: init: add txtvers=1 to mDNS properties
The spec https://developer.apple.com/bonjour/printing-specification/bonjourprinting-1.2.1.pdf
notes:

... if the meaning of any of the TXT record keys is changed, the txtvers value
will be incremented. The current value of this key is “1”, and if this key does not exist in
the TXT record, the default value of “1” is assumed. The txtvers SHOULD be the first
key/value pair in the TXT record.

Signed-off-by: Paul Donald <newtwen@gmail.com>
(cherry picked from commit 55d00e3821)
2024-02-15 00:05:59 +01:00
Paul Donald a6fe00eb7a p910nd: init: line-break and conditionalize mDNS properties
Signed-off-by: Paul Donald <newtwen@gmail.com>
(cherry picked from commit d939c5c3aa)
2024-02-15 00:05:59 +01:00
Paul Donald 84a6d8427a p910nd: init: only run mDNS changes if mdns is set to on
i.e. don't do the extra work unless mdns setting is enabled

Signed-off-by: Paul Donald <newtwen@gmail.com>
(cherry picked from commit 2c5927cfac)
2024-02-15 00:05:59 +01:00
Paul Donald 852746e9c9 p910nd: init script
Don't run procd with a name of p9100d or p9101d etc.
Use the original binary name: p910nd.

This way, all supplied parameters should be visible via e.g.:

ps
xargs -0 < /proc/{procid}/cmdline

Revise all p910nd strings to the variable DAEMON_NAME or CONFIG where
appropriate.

Signed-off-by: Paul Donald <newtwen@gmail.com>
(cherry picked from commit 3f04d2d791)
2024-02-15 00:05:59 +01:00
Chen Minqiang 44410b7350 p910nd: config trigger reload and default disabled
Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
2020-11-26 15:47:07 +08:00
Daniel F. Dickinson 932c76fa74 p910nd: Run as non-root by default
We add the necessary Makefile, hotplug, config, and init bits
so that p910nd daemon runs as user:group p910nd:lp by default.
This eliminates an unnecessary root daemon.

The hotplug script sets the permissions of the USB lp
device(s) to read-write owner and group and no access to
anyone else, and sets owner root, group lp.

This is allows sufficient privileges to p910nd
to do it's job.

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2019-08-02 15:58:57 +08:00
Philipp Kerling b9612a8354 p910nd: add mdns support
Signed-off-by: Philipp Kerling <pkerling@casix.org>
2019-04-15 23:19:39 +02:00
Francesco Molitierno a9072f7a1a p910nd: Change start init sequence to 99
Delay startup of p910nd to give devices more time to enumerate
Fixes issue #4752

Tested on mir3g
Signed-off-by: Francesco Molitierno <francyesc0@hotmail.it>
2018-07-29 13:50:28 +08:00
Maximilian Mehnert 3da1c4dbe1 p910nd: Convert p910nd init script to procd
Signed-off-by: Maximilian Mehnert <maximilian.mehnert@gmx.de>
[pkerling@casix.org: increase PKG_RELEASE version]
Signed-off-by: Philipp Kerling <pkerling@casix.org>
2016-05-01 00:10:17 +02:00
Philipp Kerling 64019e46d6 Import and update p910nd package
Signed-off-by: Philipp Kerling <pkerling@casix.org>
2014-08-03 23:28:28 +02:00