1

Updating my Linux server is mostly a stressed part for me. Like today. With yum update i see a new version of NodeJS, but from what i can remember nodejs has been used by a program which needs to be carefully altered.

So i thought, there should be a command how to find out which program is using NodeJS, but unfortunately I can't find such command.

Is there a yum command which tells me who is using NodeJS on my system? So i can check if it is ok to update?

Alex
  • 21
  • 1

1 Answers1

1

If the other programs are installed as RPM packages then you can see which ones require nodejs:

rpm -q --whatrequires nodejs

If the other programs aren't installed as RPM packages then there's no easy way. Dependency information is one of the major benefits of using a package manager, as opposed to just copying files around.

You can set up logging whenever /usr/bin/nodejs is executing and run your system for a few days to see what executes it. If the file is used as a script interpreter via a shebang line, you can use the audit subsystem:

auditctl -w /usr/bin/nodejs

and watch /var/log/audit/audit.log. If nodejs is called explicitly then this won't tell you what program executed it, but this does log the first few command line parameters, which hopefully includes a script path that would be enough information for you. Watch Monitoring what program calls an executable file for other solutions.

Alternatively, if you have an idea where that program is stored, you can search for the string nodejs. But this is likely to return a lot of false positives (e.g. documentation files).