Replace sudo with runuser in init script
Fixed credentials endpoint handling