Replies: 3 comments
-
|
Hello thorfi. It is definitely possible to customize the unix process name but you cannot achieve it directly through the default CLI flags. Next js uses the underlying Node js process title to set that name. To override it you will need to create a custom server script instead of using the standard next start command. In your root folder you can create a file named server.js and set process.title equal to whatever custom name you want right at the very top of the file. After setting the title you can initialize the Next js server programmatically using the next function from the next module. Once you bind it to your http server and start listening on your port the unix ps command will display your custom title instead of next-server for that specific application instance. This makes it very easy to distinguish between multiple projects running on the same machine. |
Beta Was this translation helpful? Give feedback.
-
|
This is set here: I guess, you could set an For when |
Beta Was this translation helpful? Give feedback.
-
|
@thorfi I don't see an official Next.js config option for customizing the unix process name shown as Common workaround is an OS/process-manager wrapper (for example Linux exec -a ...) so process listing shows your chosen label, but that is outside Next config itself. References: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
When the next server is running, the unix "ps" title when I'm running a few different apps at the same time:
Is there a way to customise the unix process title?
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions