Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8058847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:28:44+00:00 2026-06-05T09:28:44+00:00

We are required to use a mainframe-based scheduler instead of cron to perform utility

  • 0

We are required to use a mainframe-based scheduler instead of cron to perform utility tasks. This scheduler communicates with an agent on a host, which then executes a generic setuid ksh script that takes as arguments the utility to execute along with whatever args are required. The setuid ksh script then invokes another script with its args.

In my case, the next script (execute_something.ksh) sets some environment variables, cds to the Rails root and does rails runner Module.function -e <environment> where environment is the arg passed along.

So that’s:

mainframe -> agent -> setuid_script -> execute_something.ksh -> Module.function

When I invoke execute_something.ksh directly, as myself, it works fine. When I invoke the setuid script, I get the following error:

/[path]/bin/rails:15:in `force_encoding’: unknown encoding name – BINARY (ArgumentError)
from /[path]/bin/rails:15:in main

This is not a permissions thing. All the involved files are either owned by the setuid user or have full group permissions for the setgid group and belong to that group. (Yes, overkill, but that’s what I was given.)

The setuid script inherits my environment (except that there is an EUID of the setuid user).

Also, the rails script that is being executed is different from the one that installed on my linux laptop (I did mention this was a solaris problem).

The rails script is:

#!/usr/bin/env ruby
#
# This file was generated by RubyGems.
#
# The application 'railties' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'rubygems'

version = ">= 0"

if ARGV.first
  str = ARGV.first
  str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
  if str =~ /\A_(.*)_\z/
    version = $1
    ARGV.shift
  end
end

gem 'railties', version
load Gem.bin_path('railties', 'rails', version)

This works as me. I explicitly removed all references to my home directory sandbox in PATH and LD_LIBRARY_PATH – it still works for me and not for the setuid user.

I have no permissions to change things in the global environment – I have to put in requests and wait. There is no way to change the way the module must be executed.

Please someone – give me some ideas? I don’t think this applies to many people, but isn’t it an interesting puzzle?

TIA.

Carilda

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T09:28:45+00:00Added an answer on June 5, 2026 at 9:28 am

    The purpose of the rails command is to call script/rails if present, so you could just call that script directly:

    ./script/rails runner Module.function -e <environment> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Objective-C I use a Notification to do some tasks, which required some time
I am working on a project for which we are required to use transaction
I'm working on a homework assignment in which I'm required to use char arrays
For this project I am required to use an R script to simulate the
Could someone tell me which version of MySql is required to use Doctrine2 ?
I am required to use Joomla for a project which essentially consists of several
I am required to use the DevExpress ASPxGridView. I have a datasource Object which
In ASP.NET MVC, we're required to use the suffix Controller for all controllers. This
I am required to use the DevExpress ASPxGridView. I have a datasource Object which
So we're required to use the following order for CSS anchor pseudo-classes a:link {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.