-23

I spent considerable time researching and crafting a question which was unlucky enough to get a downvote from one of the first 3 to see it because it dared to ask more than one related questions at once. Thus cursed, it was doomed to be closed later.

(But it seems this now requires only 2 votes not 3 or 4 as it used to. When did this change?)

So I asked two related questions separately and had to refer comments from one to the other. Perhaps demonstrating that one question would have been better.

While I was doing this both of these questions were closed with single "golden" votes from the same user as "Not suitable for this site".

(I thought this only applied to duplicate questions - When did I get close-vote superpowers?, but apparently any moderator can do it.)

So today I am finding Stack Overflow particularly unwelcoming. Perhaps I should just flag them for moderator attention but I may as well go the whole hog and endure the meta effect as well. What is wrong with my two questions?

Was the mighty Mjölnir wielded instant close vote applied justly or not? Please explain.

A question about which API to use is better practice is surely on topic for Stack Overflow rather than superuser.

Also note:

https://superuser.com/help/on-topic

and it is not about …

programming and software development,

So superuser is definitely wrong. Voting to close as opinion based might be more reasonable.

Another bullet point against superuser:

Though I typically find that opinions matter. If the majority view is that X is better than Y or Y should be deprecated it is useful to know. I think that close reason should be reserved for when there is higher risk of conflict.


After consideration I believe the following:

My first question was off-topic. I have replaced it with a slightly improved question on unix&linux

However, I believe my second question i.e.

Is it better practice to use `/proc/pid/stat` or `/proc/pid/status`

Is on topic. More over my answer for both questions is the same:

It is better practice to use /proc/pid/status because, in my opinion at least, /proc/pid/stat should be deprecated. /proc/pid/stat is harder to parse correctly and failure to do so can result in subtle bugs and a possible security risk.

6
  • 6
    Small point of clarification, your questions were closed by an elected community moderator, not a gold badge holding regular user closing a question as a duplicate. The latter is what "Mjölnir" is used to describe. Community moderators can perform any action unilaterally and always have been able to. Flagging for moderator attention about the closure is not appropriate, since your questions already received moderator attention. You have already taken the redress available to you, posting here on Meta. Commented Apr 13, 2022 at 23:29
  • 3
    I honestly don't see where you see something about "programming [or] software development" in your questions so it would be off-topic on superuser.
    – Tom
    Commented Apr 13, 2022 at 23:34
  • 3
  • @EJoshuaS-StandwithUkraine to clarify. How is this related? Presumably that post is talking about the quality concerned curators and moderators rather than users like me? am I the demon for feeling unwelcome? Commented Apr 14, 2022 at 19:55
  • The title of the second question does not compute. For example, is it supposed to be "Is it better practice to use /proc/pid/stat or /proc/pid/status?"? Commented Apr 15, 2022 at 18:52
  • I was trying to use back tick formating in the title where its not applicable if that's what you meant. Commented Apr 15, 2022 at 21:14

2 Answers 2

-3

From my point of view, the question Given we have `/proc/pid/status` why do we still have `/proc/pid/stat`? IS about programming:

  1. It has ultimate programming goal and specifies the problem:

    This was originally prompted by a desire to extract vmPeak, vmSize, vmRSS & vmHWM from within an application.

  2. It scopes instruments which could be used for resolve the problem: /proc/<pid>/status or /proc/<pid>/stat.

    Because instruments are files, the actual programming language is secondary.

  3. It asks about policies when one instrument should be preferred to another one in a program.

I am not sure whether such policies exist, but I feel they do. Even if they do not exist, the question could be closed as "opinion based", but not because it is not about programming.

Relation of procfs with programming

It is true that files can be read both by a programmer and by a "PC user" without a programming knowledge. It is also true that many of files under /proc could be understandable by a "PC user".

But it is also true that files under /proc constitute API for programs.

Take a look into file /proc/<pid>/stat. Example of its content:

10 (bash) S 9 10 10 34816 458 4210944 1603 34436 29 200 8 0 70 15 20 0 1 0 319 10432512 1281 18446744073709551615 94023103057920 94023103964933 140733037387520 0 0 0 65536 3670020 1266777851 1 0 0 17 2 0 0 30 0 0 94023104195824 94023104243204 94023128383488 140733037394248 140733037394254 140733037394254 140733037395950 0

It is not very useful for a non-programmer person, isn't it?

man proc describes format of that file and notes "This is used by ps(1).". But it is unclear from man proc whether given file is intended to be used in other programs, which are not part of Linux-based OS. Asking about that seems for me to be perfectly on-topic on Stack Overflow.

For example, another question about /proc/<pid>/stat, which has been perfectly received on Stack Overflow.

11
  • It is really unfortunate the attitude this community has towards shell scripting sometimes. This is no more off topic than provider questions in PowerShell, because those could also be boiled down to "just paths" by the uninitiated. /proc is 100% an API most often used in systems programming, exposed as a "file system" in Unix because "everything is a file". It's just how some information is consumed, but these aren't files in the traditional sense of the word.
    – codewario
    Commented Apr 14, 2022 at 11:46
  • 1
    +1 we should be much more tolerant, about off topic and it is often difficult to determine if it is offtopic or not, in my point of view more in dubio pro reo less closure and deletion
    – nbk
    Commented Apr 14, 2022 at 13:06
  • It's often going to be how the problem is approached as to whether it's programmatic in nature. Troubleshooting problems with /proc not providing the correct information I would agree is off topic here. Questions about how to consume this as an API from scripts is and should be on topic for Stack Overflow. Asking about why there are two similar endpoints of an API would be on topic for any other language/environment. To be clear, these questions would fit under Super User and Unix/Linux, but they also fit here because they are programmatic in nature.
    – codewario
    Commented Apr 14, 2022 at 13:21
  • I'd recommend to re-write "It asks about policies when one instrument should be preferred to another one in a program." - it reads as "but this question must be closed as opinion-based" while you are trying to argue that it is on-topic... Quite confusing. Commented Apr 14, 2022 at 18:36
  • 4
    The mere fact that something was motivated by a programming task doesn't make it a programming question. Nearly all of my Super User questions were general computing problems that I encountered while programming, for example, and none of them are on-topic on this site. Commented Apr 14, 2022 at 19:35
  • @AlexeiLevenkov: Are questions about programming policies off-topic on Stack Overflow? There are "high-level" policies, which could be better asked on other sites (e.g. "Programmers"), but I saw many question on SO about "low-level" policies. E.g. a recent question about policies in the tag I follow: stackoverflow.com/questions/71855535/….
    – Tsyvarev
    Commented Apr 14, 2022 at 19:59
  • @Tsyvarev most of the time "should I use X or Y" are off-topic as opinion-based. In rare cases (like "Should I parameterize my SQL query or use string concatenation") there is a definitive answer, but it may not be obvious to asker which bucket the question falls into - I believe two linked questions are completely opinion-based as it does not look like there is a strong guidance there. It also very likely questions that can be answered with specific guidance will be downvoted as such guidance likely to be spelled out everywhere one of the options is mentioned. Commented Apr 14, 2022 at 21:45
  • I agree that questions "should I use X or Y" are in risk to fall into category "there is no preference between X and Y, use any of them" and I see many such questions even in my favorite tags (e.g. "Which structure of files fits better for my CMake project"). But from my understanding, each such question should be examined separately, and for close a question as "opinion-based" one should be a domain expert at some extent. Are you sure that there is no guidance about using /proc/<pid>/stat file from e.g. Linux kernel developers, who actually "create" that file?
    – Tsyvarev
    Commented Apr 14, 2022 at 22:05
  • "ps(1)" See what the man page numbers in parentheses mean.
    – philipxy
    Commented Apr 15, 2022 at 22:13
  • @philipxy: How is this related to the question? I am perfectly aware what this 1 means.
    – Tsyvarev
    Commented Apr 15, 2022 at 22:16
  • I have added an update to my meta question now I believe both questions have the same clear umabiguous answer. I also note that the example of a well received procfs question stackoverflow.com/questions/39066998/… - is exactly the sort which infuriates. It is a simple RTFM or google at best to find the answer. Commented Apr 16, 2022 at 11:23
23

Yes, the closure of these questions by a moderator was correct. Neither of those questions have anything to do with software development. They are questions about the /proc file system in Linux. Stack Overflow is limited to programming questions. You can ask questions about Linux over on Unix/Linux and/or Super User. (There is no need to migrate either of those questions to another site automatically, since they haven't been answered. They can just be deleted here and re-posted elsewhere.)

Note that, as pointed out by Ian Campbell in the comments, this has nothing to do with Mjölnir, which refers to duplicate closure by users holding a gold tag badge. Your questions weren't closed as duplicates; they were closed as off-topic.

8
  • 1
    The procfs filesystem is an API. It is the only way to programmatically obtain process information on Linux without writing a kernel module. That is clearly a programming question. Otherwise why even have a procfs tag on stackoverflow? Commented Apr 13, 2022 at 23:42
  • 14
    The existence of a tag doesn't mean that all questions about that thing are on-topic. We have a tag for Windows, but you can't ask how to change the screensaver on your computer; that's off-topic. The mere fact that something can be used as an API doesn't make all questions about it programming questions. Your questions aren't in the context of any software development. You're just asking about a kernel feature.
    – Cody Gray Mod
    Commented Apr 13, 2022 at 23:46
  • The word kernel implies a programmer. Most ordinary users do not even know what a kernel is. Commented Apr 13, 2022 at 23:48
  • 12
    Haha, no, the word kernel doesn't imply a programmer. The kernel is a basic part of the Linux operating system, present whether you're a programmer or not, and something which non-programmer users interact with frequently, including system and network administrators. ProcFS is not something that only a programmer would encounter (i.e., it's not a C API that is accessible only to a kernel driver), since it's presented as part of the standard file system that any user could see by simply listing a directory.
    – Cody Gray Mod
    Commented Apr 14, 2022 at 0:00
  • 2
    That's not entirely a fair analogy given the unix philosophy that "everything is a file". It would be reasonable to expect users even admins to use ps or top in preference to /proc unless they are writing a script - which makes them a programmer. Commented Apr 14, 2022 at 0:12
  • 11
    @BruceAdams your questions look almost like boat programming, "just because it mentions programming doesn't mean it's about programming". Many command-line tools can be used in scripting/programming, but the detail about how those tools work is not necessarily about programming.
    – Andrew T.
    Commented Apr 14, 2022 at 4:11
  • Put it this way. If someone was writing a book about how to use this API would they recommend using stat or status. Similarly if someone is looking dispassionately at its design what would their criticisms be. Who would such a book be aimed at? software developers. Commented Apr 14, 2022 at 14:44
  • I am a programmer. When I have a sysadmin question I try to go to superuser or unix&linux. When I have a programming question I go to stackoverflow. Stackoverflow is my default choice as it matches my job description. Sometimes I get it wrong. unix and linux actually mentions "APIs" in its "what can I post". So that is probably the best fit in this case. superuser is certainly wrong. Commented Apr 14, 2022 at 14:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .