How to change streamlit process name in ubuntu 22.04

There are two streamlits apps are running in my server, when the apps are deployed in Ubuntu VM server, we execute the following command

$ nohup streamlit run >data.out 2>&1 &
$ nohup streamlit run >data.out 2>&1 &

it creates the processes like

adminr@micro:~/$ ps -e | grep streamlit
132803 pts/0 00:00:10 streamlit
156959 pts/0 00:00:02 streamlit

can we change the process name from streamlit to custom name like “dashboard_sale” and “dashboard_college”. This would be easy for manage and redeploy.

Please help

I tired alreay python setproctitle package but it is not working

import streamlit as st
import setproctitle # installed pip install setproctitle

# Set the process title

# Streamlit app content
def main():
    st.title("Streamlit App with Process Title")

    st.write("This is a simple Streamlit app that sets the process title.")

if __name__ == "__main__":

packages requiered for running this code

pip install streamlit setproctitle

I am not a linux expert, but this should be possible with systemd service manager?

1 Like

Thanks for your reply.

Changing process name after it was created is not a good practice. That is why python packages are created to provide custom name before apps are started running. But somehow streamlit prevents custom process name it always uses streamlit as the process name.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.