I want to execute kinit when startup Jupyterhub, so added blow code in Jupyterhub config file, but it’s not working, anyone have same issue?
def pre_spawn_hook(spawner):
keytab_path = “/home/chen/test.keytab”
principal = “chen”
kinit_cmd = f"kinit {principal} -kt {keytab_path}"
os.system(kinit_cmd)
c.Spawner.pre_spawn_hook = pre_spawn_hook