[opensuse] tmpfiles.d question
Hi list, any experts for tmpfiles.d around? I have a laptop with intel ME that has a serial port. It is detected by linux (serial8250), but doesn't work because ME is disabled. Bad thing is, anything trying to access it runs into a 30s timeout :(( So I try to remove access to it using tmpfiles.d: woodstock:~ # cat /etc/tmpfiles.d/block_AMT_ttyS0.conf #Type Path Mode UID GID Age Argument z /dev/ttyS0 0600 - - - - However, after boot I still have woodstock:~ # l /dev/ttyS0 crw-rw---- 1 root dialout 4, 64 Mar 6 10:18 /dev/ttyS0 Is 'z' the wrong command? According to the manpage it should change modes of existing files/directories, and the serial module is loaded before systemd starts the tmpfiles scripts. Any ideas why it's not working? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Peter Suetterlin wrote:
Hi list,
any experts for tmpfiles.d around?
I have a laptop with intel ME that has a serial port. It is detected by linux (serial8250), but doesn't work because ME is disabled. Bad thing is, anything trying to access it runs into a 30s timeout :((
So I try to remove access to it using tmpfiles.d: woodstock:~ # cat /etc/tmpfiles.d/block_AMT_ttyS0.conf #Type Path Mode UID GID Age Argument z /dev/ttyS0 0600 - - - -
However, after boot I still have woodstock:~ # l /dev/ttyS0 crw-rw---- 1 root dialout 4, 64 Mar 6 10:18 /dev/ttyS0
Is 'z' the wrong command? According to the manpage it should change modes of existing files/directories, and the serial module is loaded before systemd starts the tmpfiles scripts.
Any ideas why it's not working?
I'm no expert, but maybe because ttyS0 is a character device, not a file? Just guessing wildly. -- Per Jessen, Zürich (7.2°C) http://www.hostsuisse.com/ - dedicated server rental in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 03/06/2018 11:56 AM, Per Jessen wrote:
Any ideas why it's not working? I'm no expert, but maybe because ttyS0 is a character device, not a file? Just guessing wildly.
I thought everything on *nix was supposed to be a file. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
James Knott wrote:
On 03/06/2018 11:56 AM, Per Jessen wrote:
Any ideas why it's not working? I'm no expert, but maybe because ttyS0 is a character device, not a file? Just guessing wildly.
I thought everything on *nix was supposed to be a file.
Yes, my thought, too. There is another option to *create* character files, but it says it would delete the device if already there, and create it new - not sure if that collides with / messes up the driver? (then again, I don't want to use it anyhow...) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 07/03/18 09:05, Peter Suetterlin wrote:
James Knott wrote:
On 03/06/2018 11:56 AM, Per Jessen wrote:
> Any ideas why it's not working? I'm no expert, but maybe because ttyS0 is a character device, not a file? Just guessing wildly.
I thought everything on *nix was supposed to be a file. Yes, my thought, too.
Except when it's not. Like networking, for example. But files can be both character (sequential access) or block (direct access). So ttyS0 is a sequential (character) file, while sda is a block (direct access) file. Cheers, Wol -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Wols Lists wrote:
On 07/03/18 09:05, Peter Suetterlin wrote:
James Knott wrote:
I thought everything on *nix was supposed to be a file. Yes, my thought, too.
Except when it's not. Like networking, for example.
But files can be both character (sequential access) or block (direct access). So ttyS0 is a sequential (character) file, while sda is a block (direct access) file.
Yes, sure. But the point was that this should not matter when just changing the permissions, which is what the 'z' was supposed to do. But probably it was indeed a timing issue, as Andrei suspected. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 07/03/18 08:05 AM, Peter Suetterlin wrote:
Wols Lists wrote:
On 07/03/18 09:05, Peter Suetterlin wrote:
James Knott wrote:
I thought everything on *nix was supposed to be a file. Yes, my thought, too.
No: its more that everything is accessible though the file system tree. Th is, you have "/dev/tty1" instead of the out of band "COM1:".
Except when it's not. Like networking, for example.
Well, yes and no. There were implementations of UNIX that did have /dev/tcp but what happened form there on down was subject to debate. Clearly there should be entries for open connections, but should they be by name or by IP address? What should be their access characteristics? Not just permissions, but many other things that have to be dealt with when using open connections. It's a minefield and the simplest answer is "Don't Go There". If anyone knows more abut this I'd be interested in hearing/learning. But see, for example https://en.wikipedia.org/wiki/9P_(protocol)
But files
Read: "entries in the hierarchical file system"
can be both character (sequential access) or block (direct access). So ttyS0 is a sequential (character) file, while sda is a block (direct access) file.
Yes, sure. But the point was that this should not matter when just changing the permissions, which is what the 'z' was supposed to do. But probably it was indeed a timing issue, as Andrei suspected.
Yes. -- A: Yes. > Q: Are you sure? >> A: Because it reverses the logical flow of conversation. >>> Q: Why is top posting frowned upon? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Wed, 7 Mar 2018 10:24:03 -0500 Anton Aylward <opensuse@antonaylward.com> wrote:
If anyone knows more abut this I'd be interested in hearing/learning.
It's generally forgotten, but I think it's important to remember that conventional Unix -- and by that I include all of them, from *BSD to macOS -- licensed code or rebuilds, it doesn't matter -- is essentially the modern, highly-developed descendant of the UNIX v1.0 project. And because its origins lie in the late 1960s, it didn't have networking, let alone TCP/IP, built in. Unix 2.0 was Plan 9 from Bell Labs. It's what Thompson and Richie did next. It brings a lot more things into the filesystem, is network-aware and network-distributed from the ground up. But it emerged that being network-aware is a problem if said network is heterogenous and not all the machines have the same CPU architecture. So Unix v3.0 was Inferno, which fixes that with the introduction of the Limbo programming language, a type-safe successor to C, which runs on the Dis VM which is built into the kernel. Programs written in Limbo can run on any of the half-a-dozen+ CPU architectures that Inferno runs on. But none of them caught on, so we're all still using much-enhanced versions or derivatives of the original from 1969. That means networking remains a bolted-on subsystem. For many years, there was a battle between 2 incompatible APIs for networking on Unix -- the UNIX System V "official" interface, STREAMS, and the Berkeley Sockets interface from 4.2BSD. https://en.wikipedia.org/wiki/STREAMS https://en.wikipedia.org/wiki/Berkeley_sockets Both are from 1983. STREAMS was Richie's answer, was initially supported in Plan 9 and also in Novell Netware, classic MacOS, FreeBSD and Windows NT. STREAMS was part of the UNIX 95 and UNIX 98 definitions. For about 25 years it was an ongoing argument or battle, akin to the Emacs/Vi war. But STREAMS never made it into Linux, which went with Berkeley Sockets. So ultimately, Sockets won. -- Liam Proven - Technical Writer, SUSE Linux s.r.o. Corso II, Křižíkova 148/34, 186-00 Praha 8 - Karlín, Czechia Email: lproven@suse.com - Office telephone: +420 284 241 084 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 07/03/18 12:37 PM, Liam Proven wrote:
But STREAMS never made it into Linux, which went with Berkeley Sockets.
So ultimately, Sockets won.
Yes, I remember programming with STREAMS I suppose one can, with a bit of imagination, fudge things with 'netcat'. And 'named pipes'... https://www.novell.com/communities/coolsolutions/piping-program-output-over-... and https://stackoverflow.com/questions/4113986/example-of-using-named-pipes-in-... Then, of course, you can also fudge things with SSH pipes. But it's not the same :-( I'd really prefer to be able to simply address /dev/tcp/google.com/80 -- A: Yes. > Q: Are you sure? >> A: Because it reverses the logical flow of conversation. >>> Q: Why is top posting frowned upon? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Content-ID: <alpine.LSU.2.21.1803071417330.18075@minas-tirith.valinor> El 2018-03-07 a las 12:52 -0000, Wols Lists escribió:
On 07/03/18 09:05, Peter Suetterlin wrote:
James Knott wrote:
On 03/06/2018 11:56 AM, Per Jessen wrote:
>> Any ideas why it's not working? I'm no expert, but maybe because ttyS0 is a character device, not a file? Just guessing wildly.
I thought everything on *nix was supposed to be a file. Yes, my thought, too.
Except when it's not. Like networking, for example.
But files can be both character (sequential access) or block (direct access). So ttyS0 is a sequential (character) file, while sda is a block (direct access) file.
Confussion here. Device files, typically inside /dev/*, can be either character mode or block mode: crw-rw----+ 1 root audio 14, 4 Mar 4 01:46 audio crw------- 1 root root 10, 235 Mar 4 01:46 autofs crw-rw---- 1 root dialout 4, 64 Mar 4 01:46 ttyS0 crw-rw---- 1 root dialout 4, 65 Mar 4 01:46 ttyS1 brw-rw---- 1 root disk 8, 0 Mar 4 01:46 sda brw-rw---- 1 root disk 8, 1 Mar 4 01:46 sda1 brw-rw---- 1 root disk 8, 2 Mar 4 01:46 sda2 ^... Regular files are just files. It refers, I understand, to the capabilities they support. A serial port outputs one character at a time, can not seek... I don't know the exact list but you get the idea. - -- Cheers Carlos E. R. (from openSUSE 42.3 x86_64 "Malachite" (Minas Tirith)) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iF4EAREIAAYFAlqf5w4ACgkQja8UbcUWM1y/BwD/Qy3kCiZglPSABECCBAjowKp+ QKFdO2y7KHT9wE4BdvkA/1SXIrbiBGQjA4e0IMLvSyV498GmY95tnCSGhZeZIhFd =MY1u -----END PGP SIGNATURE-----
On Wed, 7 Mar 2018 10:05:41 +0100 Peter Suetterlin <pit@astro.su.se> wrote:
James Knott wrote:
I thought everything on *nix was supposed to be a file.
Yes, my thought, too.
It's a good line but it's an oversimplification. As https://lwn.net/Articles/411845/ says, it would be better to say « However that term does the idea an injustice as it overstates the reality. Clearly everything is not a file. Some things are devices and some things are pipes and while they may share some characteristics with files, they certainly are not files. A more accurate, though less catchy, characterization would be "everything can have a file descriptor". It is the file descriptor as a unifying concept that is key to this design. It is the file descriptor that makes files, devices, and inter-process I/O compatible. » Plan 9 took the "everything is a file" idea much further, but sadly, it did not catch on. -- Liam Proven - Technical Writer, SUSE Linux s.r.o. Corso II, Křižíkova 148/34, 186-00 Praha 8 - Karlín, Czechia Email: lproven@suse.com - Office telephone: +420 284 241 084 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
06.03.2018 17:34, Peter Suetterlin пишет:
Hi list,
any experts for tmpfiles.d around?
I have a laptop with intel ME that has a serial port. It is detected by linux (serial8250), but doesn't work because ME is disabled. Bad thing is, anything trying to access it runs into a 30s timeout :((
So I try to remove access to it using tmpfiles.d: woodstock:~ # cat /etc/tmpfiles.d/block_AMT_ttyS0.conf #Type Path Mode UID GID Age Argument z /dev/ttyS0 0600 - - - -
The correct way to do it is to add udev rule that sets desired MODE. Something like ACTION!="", ACTION!="delete", SUBYSTEM=="tty", KERNEL=="ttyS0", MODE="0600"
However, after boot I still have woodstock:~ # l /dev/ttyS0 crw-rw---- 1 root dialout 4, 64 Mar 6 10:18 /dev/ttyS0
Is 'z' the wrong command? According to the manpage it should change modes of existing files/directories, and the serial module is loaded before systemd starts the tmpfiles scripts.
Any ideas why it's not working?
Device probing is likely asynchronous and happens after module has been loaded, so you cannot be sure tmpfiles runs after particular device node has been created. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Tue, Mar 6, 2018 at 6:54 PM, Andrei Borzenkov <arvidjaar@gmail.com> wrote:
06.03.2018 17:34, Peter Suetterlin пишет:
Hi list,
any experts for tmpfiles.d around?
I have a laptop with intel ME that has a serial port. It is detected by linux (serial8250), but doesn't work because ME is disabled. Bad thing is, anything trying to access it runs into a 30s timeout :((
So I try to remove access to it using tmpfiles.d: woodstock:~ # cat /etc/tmpfiles.d/block_AMT_ttyS0.conf #Type Path Mode UID GID Age Argument z /dev/ttyS0 0600 - - - -
The correct way to do it is to add udev rule that sets desired MODE. Something like
ACTION!="", ACTION!="delete", SUBYSTEM=="tty", KERNEL=="ttyS0", MODE="0600"
We use the serial port with gpsd. This rule sets the serial port so gpsd finds it quickly: KERNEL=="ttyS1", SYMLINK="gps", MODE="666", OPTIONS="last_rule", RUN+="/usr/bin/stty -F /dev/gps 38400" The symlink is just a convenience so we can use the name /dev/gps when we want to access this serial port. -- Roger Oberholtzer -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Roger Oberholtzer wrote:
On Tue, Mar 6, 2018 at 6:54 PM, Andrei Borzenkov <arvidjaar@gmail.com> wrote:
The correct way to do it is to add udev rule that sets desired MODE. Something like
ACTION!="", ACTION!="delete", SUBYSTEM=="tty", KERNEL=="ttyS0", MODE="0600"
We use the serial port with gpsd. This rule sets the serial port so gpsd finds it quickly:
KERNEL=="ttyS1", SYMLINK="gps", MODE="666", OPTIONS="last_rule", RUN+="/usr/bin/stty -F /dev/gps 38400"
The symlink is just a convenience so we can use the name /dev/gps when we want to access this serial port.
Thanks to both of you - I'll try this out. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Andrei Borzenkov wrote:
The correct way to do it is to add udev rule that sets desired MODE. Something like
ACTION!="", ACTION!="delete", SUBYSTEM=="tty", KERNEL=="ttyS0", MODE="0600"
Yes, this indeed nicely works (after I found the missing S, that is :D) Thanks again! -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
07.03.2018 15:34, Peter Suetterlin пишет:
Andrei Borzenkov wrote:
The correct way to do it is to add udev rule that sets desired MODE. Something like
ACTION!="", ACTION!="delete", SUBYSTEM=="tty", KERNEL=="ttyS0", MODE="0600"
Yes, this indeed nicely works (after I found the missing S, that is :D)
Which S? bor@leap423:~> cat /etc/udev/rules.d/ttyS0.rules ACTION!="", ACTION!="delete", SUBSYSTEM=="tty", KERNEL=="ttyS0", MODE="0600" bor@leap423:~> ll /dev/ttyS0 crw------- 1 root dialout 4, 64 Mar 7 19:32 /dev/ttyS0 bor@leap423:~> -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Wed, 7 Mar 2018 19:35:34 +0300 Andrei Borzenkov <arvidjaar@gmail.com> wrote:
ACTION!="", ACTION!="delete", SUBYSTEM=="tty", KERNEL=="ttyS0", MODE="0600"
Yes, this indeed nicely works (after I found the missing S, that is :D)
Which S?
SUBYSTEM instead of SUBSYSTEM, I presume. -- Liam Proven - Technical Writer, SUSE Linux s.r.o. Corso II, Křižíkova 148/34, 186-00 Praha 8 - Karlín, Czechia Email: lproven@suse.com - Office telephone: +420 284 241 084 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
07.03.2018 20:38, Liam Proven пишет:
On Wed, 7 Mar 2018 19:35:34 +0300 Andrei Borzenkov <arvidjaar@gmail.com> wrote:
ACTION!="", ACTION!="delete", SUBYSTEM=="tty", KERNEL=="ttyS0", MODE="0600"
Yes, this indeed nicely works (after I found the missing S, that is :D)
Which S?
SUBYSTEM instead of SUBSYSTEM, I presume.
Indeed. Thanks. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (9)
-
Andrei Borzenkov
-
Anton Aylward
-
Carlos E. R.
-
James Knott
-
Liam Proven
-
Per Jessen
-
Peter Suetterlin
-
Roger Oberholtzer
-
Wols Lists