<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_context_file_name(pid_file):
 """When the daemon is started write out the information which port it was using."""

    root = os.path.dirname(pid_file)
    port_file = os.path.join(root, "context.json")
    return port_file