The recommended workflow to publish routing services on ArcGIS Server for linux is to use the publish routing services utility which is available at least since version 11.0 and later. Refer to this documentation: https://enterprise.arcgis.com/en/server/latest/develop/linux/publishing-routing-services.htm for more information.